Running my app in the simulator under Instruments to check for memory leaks, it seems to be indicating a leak in this block of code:
for (NSDictionary *messageDict in messageDataArray)
{
message = [[Message alloc] init];
... set some properties on the 'message' object
[messages addObject:message];
[message release];
}
Obviously, in this loop, I’m alloc/init’ing an object, but releasing it when I’m finished with it. Wondering if this is just a symptom of how Instruments sees the activity within that loop, or if I’m losing my mind (or doing something else completely wrong).
You’re stashing each message you create into
messages… are you sure that that doesn’t eventually leak (and thus the things in it)? Or perhaps memory being leaking in your initializer, or property accessors?