开发者

remove quickly several managedObjectContext stored in a NSArray

开发者 https://www.devze.com 2023-04-03 08:27 出处:网络
for (NSManagedObject *toD开发者_JAVA百科elete in array) { [moc deleteObject:toDelete]; } is the first writting equivalent to the second one :
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

精彩评论

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

关注公众号