I have method that takes indirect pointer as argument and then, if error, set it to error object. I'm trying to turn on as many warning as possible. But one of them - Implicit ownership types on out parameters
- generates warning in this method:
- (id)doWithError:(NSError **)error {
...
}
How can I fix code to remove warning?
You can fix that warning by declaring your method as
- (id)doWithError:(NSError * __autoreleasing *)error {
// ...
}
The __autoreleasing
ownership qualifier is implicitly assumed for "out-parameters"
(see "4.4.2 Indirect parameters" in the Clang/ARC documentation),
therefore adding it explicitly does not change the code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With