crash while removing objects from NSMutableArray

前端 未结 6 581
遇见更好的自我
遇见更好的自我 2021-01-04 00:55

In my iphone project (ARC enabled) i have a nsmuatble array which contains some 5 managed objects (which are retrieved from core data ) and in some scenario i n

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 01:13

    The error message says it all,

    [__NSArrayI removeObject:]: unrecognized selector
    

    __NSArrayI is a code-word for an immutable array (NSArray), That means your surveys object is not NSMutablArray, but NSArray.

    You cannot add or remove objects from NSArray.

    Check your code. You have assigned NSArray to surveys or you have reinitialized it as NSArray.

提交回复
热议问题