I have an NSMutableArray as a member variable for a class.
In the .h file:
@interface bleh {
NSMutableArray *list;
}
@property (readonly, assign) NSMutableArray *list;
@end
In the .m file:
@implementation bleh
@synthesize list;
-(void)init;
{
list = [NSMutableArray arrayWithCapacity:30];
}
@end
Now, I'm not really an objective-C programmer, so maybe I'm missing some of the nuances, but when I do the following:
NSMutableString *listItem = [NSMutableString stringWithString:@"Foobar"];
[list addObject:listItem];
I'm getting strange behavior. Namely, I'm using this to keep a list of files that I eventually want to attach to an email and then open the picker. I'm getting a SIGABRT, and upon debugging, I find out that whenever I operate on list, I'm getting nothing. addObject messages don't increase the size of the NSMutableArray at all.
Am I missing something? Can someone show me a full implementation of setting up an NSMutableArray to be manipulated within a class in Objective C?
Thanks.
PS - Assume that I'm smart enough to put the manipulations of the NSMutableArray inside of a member function for the class containing the member variable.