Re: NSError help

2010-10-25 Thread Tom Jones
: "Tom Jones" Cc: cocoa-dev@lists.apple.com Sent: Sunday, October 24, 2010 4:05:19 PM Subject: Re: NSError help On Oct 24, 2010, at 5:54 PM, Tom Jones wrote: > I'm trying to understand why I'm getting thrown in to the debugger when using > NSError. I have three me

Re: NSError help

2010-10-24 Thread Dave Carrigan
The else will be fine, but the other half isn't because he isn't checking for nil err, as Greg and others pointed out. On Oct 24, 2010, at 7:46 PM, Stephen J. Butler wrote: > yes it will. i don't think the OP quite grasps pointer-to-pointers yet. > > On Sun, Oct 24, 2010 at 9:21 PM, Greg Guerin

Re: NSError help

2010-10-24 Thread Stephen J. Butler
yes it will. i don't think the OP quite grasps pointer-to-pointers yet. On Sun, Oct 24, 2010 at 9:21 PM, Greg Guerin wrote: > Dave Carrigan wrote: > >> This is fine, although the code in the else is useless. > > > It won't be fine if err is nil.  That's another Cocoa idiom: if the > NSError** is

Re: NSError help

2010-10-24 Thread Greg Guerin
Dave Carrigan wrote: This is fine, although the code in the else is useless. It won't be fine if err is nil. That's another Cocoa idiom: if the NSError** is nil, then no NSError* is returned. -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lis

Re: NSError help

2010-10-24 Thread Dave Carrigan
On Oct 24, 2010, at 3:54 PM, Tom Jones wrote: > 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:

Re: NSError help

2010-10-24 Thread Stephen J. Butler
On Sun, Oct 24, 2010 at 5:54 PM, Tom Jones wrote: > -(NSString *)getDataForType:(NSString *)aType error:(NSError **)err > { >    NSError *localErr = nil; >    NSString *result = [self getDataForType:aType separator:@"\t" > excludeFields:nil error:&localErr]; >    *err = *localErr; >    return res

Re: NSError help

2010-10-24 Thread Ken Thomases
On Oct 24, 2010, at 5:54 PM, Tom Jones wrote: > 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? > -(NSString *)getDataForType:(NSString *

NSError help

2010-10-24 Thread Tom Jones
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 **)er