Beware of __autoreleasing vs @autoreleasepool. The compiler is not smart enough to save the value of the __autoreleasing variable when the autostart pool is drained. This includes @autoreleasepool inside the method with the NSError ** parameter.
Beware of the __ block __ of implementing variables. This includes a block object that sets the variable NSError **. Some blocked APIs wrap a block call in an autodetection pool, so you get the same drawback as above.
Beware of an API that is virtually unsafe - not available. For example, many delegate pointers in AppKit and UIKit are unsafe and not nullified. If you arrange the object diagram incorrectly, it will work when the delegate object is released and the collection attempts to use it.
Beware of arrayed C pointers of object pointers. This can be done correctly, but if you are not careful, you will get leaks or crashes.
Beware of the noble races. If you have a multi-threaded error, all bets are disabled.
source share