0
我剛開始在覈心數據中使用NSOrderedSet
,並且嘗試添加的第一個對象失敗。我發現這篇文章描述失敗:Exception thrown in NSOrderedSet generated accessorsremoveObjectFromSetAtIndex,發送到實例的無法識別的選擇器
現在我想刪除特定索引的對象。當我調用生成的Core Data方法時,我得到了無法識別的選擇器。對我來說,它看起來像:
removeObjectFromAddressAnnotationsAtIndex:
我在想,如果我做錯了什麼,或者有也是因爲這個方法產生的錯誤,以及。當我走過時,我看到我的索引與我預期的一致,所以我不確定它是什麼。
編輯:
我用它像這樣:
[_route removeAddressAnnotationsAtIndexes:[NSIndexSet indexSetWithIndex:indexToRemove]];
[_route removeObjectFromAddressAnnotationsAtIndex:indexToRemove];
我都試過,都失敗,此錯誤:
[Route removeAddressAnnotationsAtIndexes:]: unrecognized selector sent to instance 0xea71980
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Route removeAddressAnnotationsAtIndexes:]: unrecognized selector sent to instance 0xea71980'
你能展示你使用的代碼和確切的錯誤嗎? –
@GabrielePetronella我添加了您請求的代碼。 – Crystal
它看起來不像生成訪問器中的已知錯誤,因爲'Route'似乎沒有響應那個選擇器。您確定方法命名是否正確,並且核心數據模型編輯器中的關係是「多對多」? –