Cannot add object to an NSMutableArray array

雨燕双飞 提交于 2019-11-29 14:47:46

Are you sure you have created an instance of the array before you use it?

self.simataList =[NSMutableArray array];

It could also be your self.simata being nil...

EDIT

You could create the array instance in the default init method:

-(id)init
{
    self = [super init];
    if(self)
    {
        //do your object initialization here
        self.simataList =[NSMutableArray array];
    }
    return self;
}

Most likely self.simataList is nil. Try NSLogging self.simataList itself, rather than its count.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!