我想設置一個對象的屬性後空,但它仍然無效。有誰能告訴我爲什麼,請嗎?對象仍然是一套
聲明:
@property (nonatomic, strong) ListItem *listItem
下面的代碼:
NSLog(@"Selected: %@", [self.fetchedResultsController objectAtIndexPath:indexPath]);
[listItem setCategory:[self.fetchedResultsController objectAtIndexPath:indexPath]];
NSLog(@"set %@", listItem);
和輸出:
2012-06-28 14:47:43.037 MarketList[10508:fb03] Selected: <Category: 0xb72a9e0> (entity: Category; id: 0xb7252e0 <x-coredata://F9BFC1DF-1D80-477E-9BC6-3C0949AD922F/Category/p2> ; data: {
listItem = "<relationship fault: 0x6d29930 'listItem'>";
name = "Teste 2";})
2012-06-28 14:47:43.038 MarketList[10508:fb03] set (null)
你還會創建'listItem'? –
可能重複[無法添加項目到NSMutableArray伊娃](http://stackoverflow.com/questions/7125326/cannot-add-items-to-an-nsmutablearray-ivar)和http://stackoverflow.com/questions/3683761/nsmutablearray-addobject-not-affecting-count http://stackoverflow.com/questions/1827058/nsmutablearray-addobject-not-working –