小编use*_*801的帖子

[__NSArrayI replaceObjectAtIndex:withObject:]:发送到实例的无法识别的选择器

我有一个NSMutableArray,我需要机会它的值,但我有这个错误:
[__ NSArrayI replaceObjectAtIndex:withObject:]:无法识别的选择器发送到实例0x5291db0
这是我的NSMutableArray的声明:

NSMutableArray *selectedOptions = [NSArray arrayWithObjects:[NSNumber numberWithInteger:0], nil]; 
Run Code Online (Sandbox Code Playgroud)

然后,我正在使用replaceObjectAtIndex方法,这样:

[self.selectedOptions replaceObjectAtIndex:0 withObject:[NSNumber numberWithInteger:1]];
Run Code Online (Sandbox Code Playgroud)

但我知道,那个错误,我正在使用NSMutableArray.
谢谢

cocoa objective-c nsmutablearray

4
推荐指数
2
解决办法
5788
查看次数

标签 统计

cocoa ×1

nsmutablearray ×1

objective-c ×1