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

后端 未结 6 1103
小蘑菇
小蘑菇 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:15

    The advantage is that you don't have to create the NSError object. As the documentation states:

    "A pointer to an NSError object. You do not need to create an NSError object."

提交回复
热议问题