Re: Ignoring an empty field in the address book
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.