【发布时间】:2013-10-29 14:38:13
【问题描述】:
这是我的代码
NSMutableArray * reversedNamesArray; //theres about a thousand variable already stored in here, this is just for documentation
reversedNamesArray = [reversedNamesArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
//Incompatible pointer type assigning "NSMutableArray" to "NSArray"
上面的消息是我得到的,我知道这意味着什么,但我不想采取额外的步骤将一千个变量的 NSMutableArray 复制到 NSArray 是否有任何演员可以用来修复警告,它不会影响我的代码,但我只想修复它。你能解释一下为什么它们不兼容吗?它们 NSMutableArray 和 NSArray 应该使用相同数量的字节,所以我不明白它们为什么不兼容。
【问题讨论】:
标签: objective-c arrays nsmutablearray nsarray