NSMutableArray in appdelegate - EXEC_BAD_ACCESS

Posted by Tejaswi Yerukalapudi on Stack Overflow See other posts from Stack Overflow or by Tejaswi Yerukalapudi
Published on 2010-06-07T15:44:45Z Indexed on 2010/06/07 15:52 UTC
Read the original article Hit count: 226

Filed under:
|

Hi,

I'm trying to use a global array in the appdelegate as a quick fix for a demo I'm building. The relevant code for this

.h file has the declaration

{
NSMutableArray *trnEntered;
}

@property (nonatomic, retain) NSMutableArray *trnEntered

.m file has the following code -

trnEntered = [[NSMutableArray alloc] init];
NSLog(@"%@",[trnEntered count]); // prints null.
[trnEntered addObject:@"1"];
NSLog(@"%@",[trnEntered count]); // exec bad access.

Not sure where I'm going wrong here. Looks fairly straight forward.

Thanks for the help in advance,
Teja.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk-3.0