开发者

remove quickly several managedObjectContext stored in a NSArray

for (NSManagedObject *toD开发者_JAVA百科elete in array) {
    [moc deleteObject:toDelete];
}

is the first writting equivalent to the second one :

[array makeObjectsPerformSelector:@selector(deleteObject:) withObject:moc];

and if not, what would be the correct way for the second writting ?

Thanks


These are different statements. The latter is equivalent to this:

for (NSManagedObject *toDelete in array) {
  [toDelete deleteObject:moc];
}

The former is correct and is generally what you should use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜