私は理由もなくNSMutableArray
私に与えるという問題に直面しています。Exc_Bad_Access
約 700 のレコードを含むがありUITableView
ます。フィルター プロセスを有効にしたいのですが、次の方法を使用して のコンテンツをフィルター処理していますUITableView
。
- (void) filterTableContentWith:(int)_minValue andWith:(int)_maxValue {
[tableContent removeAllObjects];
tableContent = [[NSMutableArray alloc] initWithArray:originalTableContent copyItems:YES];
if (_minValue == 0 && _maxValue == 0) {
NSLog(@"This is mean that no filter is activate here");
} else {
for (int x = ([tableContent count] - 1); x >= 0; x--) {
if ([[[tableContent objectAtIndex:x] objectForKey:@"price"] intValue] < _minValue && [[[tableContent objectAtIndex:x] objectForKey:@"price"] intValue] > _maxValue) {
[tableContent removeObjectAtIndex:x];
}
}
}
NSLog(@"tableContent count = %@",[tableContent count]);
[self.tableView reloadData];
}
このメソッドを呼び出すとExc_Bad_Access
、NSLog(@"tableContent count ...
[tableContent removeAllObjects];
それは配列を解放していると思いますが、それは不合理です。
どんな助けでも大歓迎です。