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: Sun, 05 Jan 2003 21:24:31 -0800
Well, it looks like most of us are stumped. From the bit of offlist help I
got, this one onlist message, and some more messing around on my part, I
have come to the conclusion it is not possible to check if a property exists
for a given ABPerson (for example checking if the given person has a company
associated with them or not).
So what I wonder is how others get around this. How do you list all the
names in the address book in your programs for example? My address book has
some entries with no last names, and my code just craps out at that point
(once it tries to grab the last name on a record that doesn't have one, it
quits out). And I can't check if the record has a last name or not, because
it just raises an exception. You would think it should just return n empty
string...
>
Try changing that if statement to:
>
if ([[peopleFound objectAtIndex:i] valueForProperty:kABLastNameProperty])
Unfortunatly same thing. It stops and says:
[NSCFString stringByAppendingString:]: nil string (or other) argument
It is never making it past [peopleFound objectAtIndex:i]
valueForProperty:kABLastNameProperty]. If I just do the following:
NSLog([peopleFound objectAtIndex:i] valueForProperty:kABLastNameProperty])
It wont do that line (I would have thought it would display an empty string
at least), and reports:
[NSCFString stringByAppendingString:]: nil string (or other) argument
So it is something about checking none existent properties I guess...
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.