I create an NSMutableArray:
SBJsonParser *parser = [[SBJsonParser alloc] init];
NSMutableArray *components = [parser objectWithString:@"[\"Item1\",\"Item2\"]"];
then I access it from the same method: no problem!
Then I try to access it from another object: crash!!??
It doesn’t happen if i create the NSMutableArray with other means (e.g. initWithObjects:)
Any clue?
It’s been all day I can’t find a solution to this.
The array returned from
[parser objectWithString:]is autoreleased; you need toretainit yourself if you want to keep it around.(You’re also probably leaking
parserunless you’re releasing it later in your method.)