Search code examples
objective-ccocoacocoa-bindings

Cocoa bindings between NSTableView and NSMutableArray refuse to update


Ok, I'm very new to Obj-C and Cocoa, but I'm sure my bindings here are correct. I've been googling, searching stack overflow and have checked my values again and again.

So, here are my bindings:

They connect to this class:

@interface TMMaddMangaWindowDelegate : NSWindowController {
...
}
...
@property (copy) NSMutableArray* mangaList;
...
@end



@implementation TMMaddMangaWindowDelegate
...
@synthesize mangaList;
// - (NSMutableArray*) mangaList {
//   NSLog(@"mangaList was called!");
//   return mangaList;
//}
//- (void) setMangaList:(NSMutableArray *) input{
//  NSLog(@"setMangaList was called!");
//  [mangaList autorelease];
//  mangaList = [input retain];
//}
...
-(void) populateList:(NSArray*)list{
    NSMutableArray* newArray = [[NSMutableArray alloc] initWithArray:list];
    NSLog(@"Populating List.");
    for(NSXMLNode* node in list){
        [newArray addObject:node.description];
        //[[self mutableArrayValueForKey:@"mangaList"] addObject:node.description];
            //NSLog(@"%@", node.description);
    }
    [self setMangaList:newArray];
    [[self chapterListDownloadIndicator] stopAnimation:self];
}

As you can see, I also tried the mutableArrayValueForKey approach, which yielded nothing. I know for a fact mangaList is gaining items.

I've been working on this for a while, and probably made a stupid mistake.

Thanks in advance.


Solution

  • It turns out that the problem was that the window did not have the class identity of Files Owner set to my window controller/delegate. The moment I set this the window sprang to life.

    That problem was also preventing my NSProgressIndicator from working.