• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Binding a model's ivar array to the contents of an NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding a model's ivar array to the contents of an NSArrayController


  • Subject: Re: Binding a model's ivar array to the contents of an NSArrayController
  • From: Todd Heberlein <email@hidden>
  • Date: Wed, 16 Sep 2009 09:35:43 -0700

So in short, my need is pretty simple: Bind an array to an NSArrayController. That being said, it seems that no combination of exposeBindings:, bind:toObject:withKeypath:options:, observeValueForKey:ofObject:change:context:, etc. is working as I expect it to. Admittedly, I have done most of my binding work via IB and I've never really done much with bind:toObject:withKeypath:options: before, so I wouldn't be surprised to find that that was where my problem lay.

Might be a stupid question on my part, but are you using the appropriate accessors for your array? For example, if you have


@interface MyDocument : NSDocument
{
	NSMutableArray*		myStuff;
}

You then need use accessors of the form:

-(NSUInteger)countOfMyStuff;
-(id)objectInMyStuffAtIndex:(NSUInteger)index;
-(void)insertObject:(id)newObj inMyStuffAtIndex:(NSUInteger)index;
-(void)removeObjectFromMyStuffAtIndex:(NSUInteger)index;

Todd

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Binding a model's ivar array to the contents of an NSArrayController (From: A B <email@hidden>)

  • Prev by Date: Re: Filtering a table view using NSSearchField
  • Next by Date: Re: Debug-level messages don't appear in Console even after asl_set_filter()
  • Previous by thread: Re: Binding a model's ivar array to the contents of an NSArrayController
  • Next by thread: Re: Binding a model's ivar array to the contents of an NSArrayController
  • Index(es):
    • Date
    • Thread