diff -r a9da6c5d3f7c -r 256370e8935a MYErrorUtils.h --- a/MYErrorUtils.h Sat Apr 04 20:53:53 2009 -0700 +++ b/MYErrorUtils.h Sun May 03 10:13:31 2009 -0700 @@ -24,6 +24,13 @@ NSError *MYError( int errorCode, NSString *domain, NSString *messageFormat, ... ) __attribute__ ((format (__NSString__, 3, 4))); +/** A variant of MYError, useful for returning from a method. + If errorCode is nonzero, constructs an NSError and stores it into *outError, + then returns NO. Otherwise returns YES. */ +BOOL MYReturnError( NSError **outError, + int errorCode, NSString *domain, NSString *messageFormat, ... ) + __attribute__ ((format (__NSString__, 4, 5))); + /** Convenience function for creating NSErrors. Stores an NSError into *error, and returns NO. Domain will be MYErrorDomain, code will be kMYErrorMisc.