Re: Ignoring an empty field in the address book (bug?)
Re: Ignoring an empty field in the address book (bug?)
- Subject: Re: Ignoring an empty field in the address book (bug?)
- From: Ben Mackin <email@hidden>
- Date: Mon, 06 Jan 2003 11:35:15 -0800
On 1/6/03 1:09 AM, "Angela Brett" <email@hidden> wrote:
>
So, if you put a breakpoint on -[NSExeption raise] is the exception
>
raised from somewhere within the valueForProperty: code?
>
>
The only thing I can think of (and I'm grasping at straws here) is
>
that perhaps there is a line before that which calls
>
-stringByAppendingString, and you're perhaps fooled into thinking
>
it's within [peopleFound objectAtIndex:i]
>
valueForProperty:kABLastNameProperty] if you have a breakpoint on
>
that line because breakpoints aren't always where they appear to be.
I just found out what the issue was. It was the line right after. What I had
was this:
if([[peopleFound objectAtIndex:i] valueForProperty:kABLastNameProperty])
{
NSLog(@"No last name");
temp3String = tempString;
}
else
temp3String = [temp2String stringByAppendingString:[[peopleFound
objectAtIndex:i] valueForProperty:kABLastNameProperty]];
The problem is that this would jump to the else if there was no last name,
and would try to append the nil string. I don't know why when I NSLogged my
code, I didn't see that it was doing this. I need to learn how to better use
the debugger, and probably would have caught this on my own. Simply
switching the else with the other code corrected the issue.
So thanks everyone!
Thanks,
Ben
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.