NSError help
NSError help
- Subject: NSError help
- From: Tom Jones <email@hidden>
- Date: Sun, 24 Oct 2010 15:54:37 -0700 (PDT)
Hello,
I'm trying to understand why I'm getting thrown in to the debugger when using NSError. I have three methods and I'm overloading them and trying to pass the NSError along the way. What am I doing wrong?
Thanks,
tom
Code:
-(NSString *)getDataForType:(NSString *)aType error:(NSError **)err
{
NSError *localErr = nil;
NSString *result = [self getDataForType:aType separator:@"\t" excludeFields:nil error:&localErr];
*err = *localErr;
return result;
}
-(NSString *)getDataForType:(NSString *)aType excludeFields:(NSArray *)aFields error:(NSError **)err
{
NSError *localErr = nil;
NSString *result = [self getDataForType:aType separator:@"\t" excludeFields:aFields error:&localErr];
*err = *localErr;
return result;
}
-(NSString *)getDataForType:(NSString *)aType separator:(NSString *)aSeperator excludeFields:(NSArray *)aFields error:(NSError **)err
{
BOOL isValidQuery = [self hasValidType:aType];
if (isValidQuery == NO) {
NSMutableDictionary *errorDetail = [NSMutableDictionary dictionary];
[errorDetail setValue:@"Failed to find the requested type." forKey:NSLocalizedDescriptionKey];
*err = [NSError errorWithDomain:@"DataForType" code:1 userInfo:errorDetail];
return nil;
} else {
err = nil;
}
...
...
...
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden