views:

36

answers:

2

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.

A: 

It looks like you are changing mangaList behind the array controller's back. Whenever you are making a change to mangaList you should first call [self willChangeValueForKey:@"mangaList"]; and then [self didChangeValueForKey:@"mangaList"]; once you are done with the change. this will let the array controller know it needs to take a look at what changed.

theMikeSwan
A: 

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.

Ripdog