On Nov 23, 2012, at 9:57 PM, Quincey Morris <quinceymor...@rivergatesoftware.com> wrote:
> On Nov 23, 2012, at 20:18 , "C.W. Betts" <computer...@hotmail.com> wrote: > >> I'm trying to get my program PlayerPRO Cocoa to display the contents of the >> music list. I was able to put things into the list, but they do not show up >> in the table view. >> (Full code is available at sourceforge.net/projects/playerpro, on the >> PlayerPRO6 branch) >> >> I have it set up so that the App Delegate has a reference to the PPMusicList >> class defined as musicList. PPMusicList has a mutable array with contents of >> PPMusicListObject; the PPMusicListObject has two values: an NSURL that has >> the full path of a file (musicUrl), and the file's name (fileName). the >> PPMusicList class that has the following defines: >> >> - (NSUInteger)countOfMusicList; >> - (id)objectInMusicListAtIndex:(NSUInteger)idx; >> - (void)insertObject:(id)anObj inMusicListAtIndex:(NSUInteger)idx; >> - (void)removeObjectInMusicListAtIndex:(NSUInteger)object; >> - (void)replaceObjectInMusicListAtIndex:(NSUInteger)index >> withObject:(id)anObject; >> >> There is an Array controller bound to the app delegate with the model key >> path set to musicList and the table is bound to the array controller with >> the model key path set to fileName. >> >> What am I doing wrong? > > Your app delegate isn't KVO compliant for the "musicList" property. The > PPMusicList class isn't KVO compliant for the "musicList" property. In both > cases, you're altering an ivar (or the array pointed to by an ivar) directly, > so there are going to be no KVO notifications and bindings aren't going to > work. Thank you. I'll look into implementing KVO. > > You realize, don't you, that your array of PPMusicListObject instances is > appDelegate.musicList.musicList? That means your array controller requires a > key path of "musicList.musicList" too. I thought that might be an issue. Thanks for confirming it. > > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com