Example: The -save:
method of NSManagedObjectContext
is declared like this:
- (BOOL)save:(NSError **)error
Since
It is what some people refer to as an "out" parameter.
You're not passing a pointer to an NSError object, you're passing a pointer to a local variable. This gives the called method the ability to modify your local variable; in this case, to assign it to an NSError instance.
Perhaps what's confusing is that the local variable you're passing to save:
is itself a pointer, so the variable type ends up being a pointer to a pointer.
Bottom line, it's a pointer to a local variable, and it works the same whether the local variable is an int
or an NSError*
.