jjzjj

rcsRecentSearchDataSource

全部标签

ios - *** 集合 <__NSArrayM : 0x117d7320> was mutated while being enumerated. '

我在实现搜索功能时犯了一个错误。我开了一个异步线程。但是当删除一个字符(电话号码的数字)时,应用程序会崩溃。错误:***Terminatingappduetouncaughtexception'NSGenericException',reason:'***Collectionwasmutatedwhilebeingenumerated.'代码:-(void)searchBar:(UISearchBar*)searchBartextDidChange:(NSString*)searchText{//self.isSearch=YES;//removethelastsearchallthe