• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ignoring an empty field in the address book


  • Subject: Re: Ignoring an empty field in the address book
  • From: Angela Brett <email@hidden>
  • Date: Sat, 4 Jan 2003 15:37:14 +1300

It looks like you're testing [[peopleFound objectAtIndex:i] valueForProperty:kABLastNameProperty] against @"" when it's actually nil. So isEqualToString: would return 0 since it's a message to nil, then the code would get to temp3String = [temp2String stringByAppendingString:... and try to append that nil string to temp2String, which causes that error.

Try changing that if statement to:
if ([[peopleFound objectAtIndex:i] valueForProperty:kABLastNameProperty])

As for the +properties method, it is a class method (note the +) and you were sending it to an instance. You should use [ABPerson properties] rather than [peopleFound properties], although I don't think it will be useful in your case since it returns all the property names, not just the ones which a particular instance has.
--
Angela Brett email@hidden http://acronyms.co.nz/angela
A mathematician is a machine for turning coffee into theorems -- Paul Erdos
_______________________________________________
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.
  • Follow-Ups:
    • Re: Ignoring an empty field in the address book (bug?)
      • From: Ben Mackin <email@hidden>
    • Re: Ignoring an empty field in the address book
      • From: Ben Mackin <email@hidden>
References: 
 >Ignoring an empty field in the address book (From: Ben Mackin <email@hidden>)

  • Prev by Date: beginSheetForDirectory
  • Next by Date: Re: Crop an image in memory
  • Previous by thread: Ignoring an empty field in the address book
  • Next by thread: Re: Ignoring an empty field in the address book
  • Index(es):
    • Date
    • Thread