Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BadWolf13

macrumors 6502
Original poster
Dec 17, 2009
271
0
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:

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?
 
Try a different name. A property windowsControllers is already there, the standard windowcontroller array, which is in fact a NSArray
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.