Hi everyone, I've got a doozy here that I can't figure out, and can't find a solution anywhere to.
I've declared an NSMutableArray within my app delegate class, and in that class, I can add and remove objects to my heart's content. However, when I access the mutable array from another class, XCode seems to think it's an immutable array. I enter this code:
And I get the error:
Even stranger, when I typed that line of code, the autocomplete window showed windowControllers as an NSArray. Just to show that it's declared and initialized properly, here's the code for the declaration and initialization of the mutable array:
Anyone got any ideas?
I've declared an NSMutableArray within my app delegate class, and in that class, I can add and remove objects to my heart's content. However, when I access the mutable array from another class, XCode seems to think it's an immutable array. I enter this code:
Code:
[[[NSApp delegate] windowControllers] addObject:newWindowController];
And I get the error:
No visible @interface for 'NSArray' declares the selector 'addObject:'
Even stranger, when I typed that line of code, the autocomplete window showed windowControllers as an NSArray. Just to show that it's declared and initialized properly, here's the code for the declaration and initialization of the mutable array:
Code:
NSMutableArray *windowControllers;
Code:
@property (strong) NSMutableArray *windowControllers;
Code:
windowControllers = [[NSMutableArray alloc] init];
Anyone got any ideas?