Object cannot be nil error

后端 未结 3 1926
臣服心动
臣服心动 2021-01-29 16:15

I am getting an error when I try to add a new object to dataArray. This is how I define dataArray.

-(NSMutableArray *)dataArray{
    i         


        
3条回答
  •  北恋
    北恋 (楼主)
    2021-01-29 16:56

    Your argument to addObject: is likely nil.

    Test it:

    assert(attributeDict);
    assert([attributeDict objectForKey:@"level"]);
    assert([attributeDict objectForKey:@"probability"]);
    

提交回复
热议问题