I synthesized an NSMutableArray
called email, which is part of an object Person. The email array contains pointers to several NSMutableString
objects.
@property (strong) NSMutableArray *email;
@synthesize email = _email;
The string was declared (in the init method of the email object) as follows:
NSMutableString *s = [NSMutableString stringWithFormat:@"Blah"];
With this, I get a bad access error when I later executed an [email count]
command in a different method. I use automatic retain counting ARC. Why does this happen?
EDIT: It turned out to be important that the output of [email count]
was printed using %@, which won't work most of the time, see below.