/*今天本来在研究tableView:moveRowAtIndexPath:toIndexPath:这个方法,但是一个crash,让我有了一些有意思的发现,从而让我对内存管理有了更深的认识,不过这些只是我的个人理解,或许不正确,希望大家看过以后也可以发表一下意见*/
首先我就直接上一段代码
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{
NSInteger fromRow = [sourceIndexPath row];
NSInteger toRow = [destinationIndexPath row];
id obj = [self.mArr objectAtIndex:fromRow];
//NSLog(@"%d,%p",[obj retainCount],obj);--------------1
//NSLog(@"%p",[self.mArr objectAtIndex:fromRow]);-----2