jjzjj

NSArrayM

全部标签

objective-c - [__NSArrayM 插入对象 :atIndex:]: object cannot be nil - how determine where is the error?

我有一个带有异步事件的大项目,有时我会出错[__NSArrayMinsertObject:atIndex:]:objectcannotbenil,但我不知道在哪里抛出这个错误..我怎样才能捕捉到这个错误?我在进行操作insertobject:atIndex的任何地方都进行了断言,什么都没有..这是堆栈:***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'***-[__NSArrayMinsertObject:atIndex:]:objectcannotbenil'***Firstthro

ios - 异常的 UITableView 崩溃 -[__NSArrayM objectAtIndex :]: index 0 beyond bounds for empty array

我进行了大量搜索,但没有找到似乎可以解决我遇到的问题的答案。我有一个UITableViewController。在viewDidLoad方法中,我从数据库加载对象,然后调用reloadData。现在一般来说这工作正常。但是,现在我正在实现排序,它会持续存在,以便在下一次应用程序启动时使用相同的排序算法。请注意,在所有情况下,支持该部分的数组的大小在排序后都是相同的。如果我使用默认排序方法,即使它运行相同的排序>调用委托(delegate)>reloadTable代码路径,我也不会崩溃。但是,如果我使用使用相同代码路径的替代排序方法,我会看到TableView要求行数,并获得正确的数字,

ios - Swift JSON 错误,无法将类型 '__NSArrayM' (0x507b58) 的值转换为 'NSDictionary' (0x507d74)

我正在尝试从url(json文件)中获取数据,但在这些行中出现此错误:varjsonResult=NSJSONSerialization.JSONObjectWithData(data,options:NSJSONReadingOptions.MutableContainers,error:&err)as!NSDictionaryif(err!=nil){println("JSONError\(err!.localizedDescription)")}错误说Thread6:signalSIGABIRT-Couldnotcastvalueoftype'__NSArrayM'(0x518b

ios - UITableView insertRowsAtIndexPaths 抛出 __NSArrayM insertObject :atIndex :'object cannot be nil' error

我正在尝试将一个项目动态地插入到我的TableView中。我的应用程序有一个聊天部分,它在第0部分显示旧消息(在初始化ViewController之前从服务器加载),并在第1部分显示刚刚发送/接收的消息(最初为零)。加载View时,所有“旧”消息都已加载并显示,没有问题。当我尝试插入行时,问题就开始了。这是我正在做的:我首先通过添加一个额外的项目来更新我的TableView的数据源:[newMessagesaddObject:newMessage];(newMessage是我的自定义消息对象的一个​​实例,newMessages是我的数据源).我确认我的数据源现在有1个项目(添加前为0

ios - UITableView insertRowsAtIndexPaths 抛出 __NSArrayM insertObject :atIndex :'object cannot be nil' error

我正在尝试将一个项目动态地插入到我的TableView中。我的应用程序有一个聊天部分,它在第0部分显示旧消息(在初始化ViewController之前从服务器加载),并在第1部分显示刚刚发送/接收的消息(最初为零)。加载View时,所有“旧”消息都已加载并显示,没有问题。当我尝试插入行时,问题就开始了。这是我正在做的:我首先通过添加一个额外的项目来更新我的TableView的数据源:[newMessagesaddObject:newMessage];(newMessage是我的自定义消息对象的一个​​实例,newMessages是我的数据源).我确认我的数据源现在有1个项目(添加前为0

iphone - 什么是 __NSArrayI 和 __NSArrayM?如何转换为 NSArray?

什么是__NSArrayI和__NSArrayM?__NSArrayI(orM)导致“无法识别的选择器”错误。如何转成NSArray?我确实测试过解析json,twitterapi。http://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=twitterapi==>工作正常。解析的对象是NSCFDictionary类。(这个字典包含__NSArrayM类)http://api.twitter.com/1/statuses/user_timeline.json?&screen_name=twitterapi==>错

iphone - 什么是 __NSArrayI 和 __NSArrayM?如何转换为 NSArray?

什么是__NSArrayI和__NSArrayM?__NSArrayI(orM)导致“无法识别的选择器”错误。如何转成NSArray?我确实测试过解析json,twitterapi。http://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=twitterapi==>工作正常。解析的对象是NSCFDictionary类。(这个字典包含__NSArrayM类)http://api.twitter.com/1/statuses/user_timeline.json?&screen_name=twitterapi==>错

ios - 无法将类型 '__NSArrayM' (0x34df0900) 的值转换为 'NSDictionary' SWIFT

当解码来自网络服务的JSON响应时,我收到一条错误消息:Couldnotcastvalueoftype'__NSArrayM'(0x34df0900)to'NSDictionary'我也尝试了很多在StackOverflow中找到的解决方案,但没有任何效果。我的代码:letjsonData:NSDictionary=(NSJSONSerialization.JSONObjectWithData(urlData!,options:NSJSONReadingOptions.MutableContainers,error:&error)as?NSDictionary)!letsuccess:

ios - 无法将类型 '__NSArrayM' (0x34df0900) 的值转换为 'NSDictionary' SWIFT

当解码来自网络服务的JSON响应时,我收到一条错误消息:Couldnotcastvalueoftype'__NSArrayM'(0x34df0900)to'NSDictionary'我也尝试了很多在StackOverflow中找到的解决方案,但没有任何效果。我的代码:letjsonData:NSDictionary=(NSJSONSerialization.JSONObjectWithData(urlData!,options:NSJSONReadingOptions.MutableContainers,error:&error)as?NSDictionary)!letsuccess:

ios - 由于未捕获的异常 'NSRangeException' 而终止应用程序,原因 : '*** -[__NSArrayM objectAtIndex:]: index 5 beyond bounds [0 .. 4]' in IOS

-(void)tableView:(UITableView*)tableViewwillDisplayCell:(UITableViewCell*)cellforRowAtIndexPath:(NSIndexPath*)indexPath{data_web*current_data;current_data=[[structured_questiondata_webs]objectAtIndex:indexPath.row];NSString*is_submited=[NSStringstringWithFormat:@"%@",[current_datacontent_2]];if(