I was designing a class and I realize that I've got several methods that the only parameter they have is the output parameter for errors. The problem is how should I name this methods, because they can get very confusing. I've been reading the Apple's Code Guidelines and it saids nothing about this. Here is an example:
-(BOOL)loginError(NSError **) anError;
-(BOOL)loginWithUsername:(NSString *)aUsername password:(NSString *)aPassword error:(NSError **) anError;
The second one is very clear but the first one seems to be very confusing to me.
What do you think?
Apple use names such as
- (BOOL) saveValuesAndReturnError:(NSError **) error;
So, perhaps:
- (BOOL) loginAndReturnError:(NSError **) error;
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