What's the Point of (NSError**)error?

后端 未结 6 1098
小蘑菇
小蘑菇 2020-12-16 20:33

Example: The -save: method of NSManagedObjectContext is declared like this:

- (BOOL)save:(NSError **)error

Since

6条回答
  •  抹茶落季
    2020-12-16 21:13

    It allows the method to allocate a new NSError and change the pointer to point to it, rather than having to modify the NSError already pointed-to (what if it's not big enough?)

提交回复
热议问题