I am trying to load next 10 rows of data in tableView when program fetches the last row in
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath I am using single function with pagenumber parameter to load the consecutive pages. It works for first fetch i.e. pagenumber 0, but when I call it again to fetch next page rows, it gives me this error
-[CFString respondsToSelector:]: message sent to deallocated instance After banging my head for a long time, I've found that it creates this problem when trying to access the NSMutableArray of my Model objects. I am using it this way :
TableRowObjectClass* TempObject = [[TableRowObject alloc] init]; for(int i=0;i<rowArray.count;i++){ TempObject = [rowArray objectAtIndex:i]; NSString* objectProperty = [[[NSString alloc] initWithFormat:@"String Property I need from Object to be appended with some text from TableRowObject Class : %@",TempObject.objProperty] retain]; [propertyArray addObject:objectProperty]; [objectProperty release]; } Here I get array of Model Objects(TableRowObjectClass's Objects) and I want to extract objectProperty from TempObject and create and array of all those properties. Initially, for pagenumber 0, it fetches 20 rows, now when I am displaying 20th row I call fetch, which call this function to create a fresh Array of objectProperty and I call [TableView reloadData] to show the frsh feed with 20(old)+20(fresh) feeds.
Now its creating this error
-[CFString respondsToSelector:]: message sent to deallocated instance when trying to access,
NSString* objectProperty = [[[NSString alloc] initWithFormat:@"String Property ....TableRowObject Class: %@",TempObject.objProperty] retain]; I am not sure what and where is it getting dealloc. I've spent alot of hours on this and I am not really good with objective-c memory management.
Your help is highly appreciated.