I have an iPhone app where one view, View A, updates another view in a tab bar, View B, using:
// This works.
- (void) reloadData
{
MyDB * db = _GET_DB_CLASS;
if(data != nil) // data is a property of type NSMutableArray
[data release];
NSMutableArray * d = [db getDataQuery];
data = s; // Don't release since we are not using the accessor. And retain count should be 1.
}
If I do this, it doesn't work (e.g. I update B, then switch to B, crash. I can't see anything useful in the logs either ... ).
NSMutableArray * d = [db getDataQuery];
self.data = s; // Doesn't work
[data release];
I have not used a custom setter. What is going on?