i'm a newbie of the world of objective-c.
what i'd like to know is how to check whether a mutable array object exists.
here is an exmaple.
if(![appDelegate.answerList objectAtIndex:3])
{
answer = [[NSMutableArray alloc] init];
}
else
{
answer = [[NSMutableArray alloc] initWithArray:[appDelegate.answerList objectAtIndex:3]];
}
above this code, 'answer' object is local, and 'answerList' object is on appDelegate class.
both are NSMutableArray objects.
i don't know whether answerList's third object is allocated or not.
If it already has an object, i wanna just copy an object from answerList's third object.
But that code doesn't work.
I'm not familiar with objective-c's methods.
please show me the way.