开发者社区> 问答> 正文

做搜索栏的时候报mutating method sent to immutable object

跟着iOS5开发基础教程上面做示例,第8章有个搜索栏,我做出来之后就是没法搜索,后面断点跟踪了下。部分代码如下:
(void)handleSearchForItem:(NSString )searchItem{ NSMutableArray sectionsToRemove = [[NSMutableArray alloc] init]; [self resetSearch]; for (NSString
当程序走到[array removeObjectsInArray:toRemove];这行时就报错:WebKit discarded an uncaught exception in the webView:shouldInsertText:replacingDOMRange:givenAction: delegate: -[__NSCFArray removeObjectAtIndex:]: mutating method sent to

展开
收起
杨冬芳 2016-07-01 17:24:35 1797 0
1 条回答
写回答
取消 提交回答
  • IT从业

    screenshot

    2019-07-17 19:50:16
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载