您的位置:首页 > 移动开发 > Objective-C

NSArrayI insertObject:atIndex:]: unrecognized selector sent to instance 0x9c754c0 2013-06-19 00:16:0

2013-11-12 18:10 936 查看
NSUInteger count=indexPath.row+1;
NSMutableArray *arCells=[NSMutableArray array];
for(NSDictionary *dInner in ar ) {
[arCells addObject:[NSIndexPath indexPathForRow:count inSection:0]];
if (tableView == self.searchDisplayController.searchResultsTableView)
//crashing
//  [self.FilterArray insertObject:dInner atIndex:count++];
else
[self.arForTable insertObject:dInner atIndex:count++];
[insertedIndexPath addObject:[NSIndexPath indexPathForRow:count inSection:0]];
}


This
error 'unrecognized selector sent to instance' typically mean the object receiving the message isn't what you think it is. And typically, this means the address got dereferenced and reassigned to another object. So you have a retain count problem somewhere

Sounds
like your
@property
declaration
for
arForTable
does
not have a strong attribute
so there's no retention

it's
crashing for Filterarray only and property have the retain attribute

This
error 'unrecognized selector sent to instance' typically mean the object receiving the message isn't what you think it is. And typically, this means the address got dereferenced and reassigned to another object. So you have a retain count problem somewhere

NSMutableArray
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: