• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ignoring an empty field in the address book (bug?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: what #ifdef's should I use?
  • Next by Date: Re: Internet programming, point me?
  • Previous by thread: Re: Ignoring an empty field in the address book (bug?)
  • Next by thread: Re: ObjC was: Checking OS Version with Cocoa
  • Index(es):
    • Date
    • Thread