Re: Setting company checkbox programatically in an AddressBook
Re: Setting company checkbox programatically in an AddressBook
- Subject: Re: Setting company checkbox programatically in an AddressBook
- From: development2 <email@hidden>
- Date: Tue, 9 Dec 2008 14:50:53 -0700
On Dec 9, 2008, at 2:31 PM, Nick Zitzmann wrote:
On Dec 9, 2008, at 2:18 PM, development2 wrote:
int personFlags = [[addressItem valueForProperty:kABPersonFlags]
intValue];
That should be an NSInteger, not an int, and you should use -
integerValue instead.
Yeah thanks, saw that in the docs but forgot about it.
personFlags = (kABShowAsMask && kABShowAsCompany);
That should be one ampersand, not two.
Yeah I had changed that right after I sent the email out when I saw it
was wrong.
[addressItem removeValueForProperty:kABPersonFlags];
[addressItem setValue:[[NSNumber numberWithInt:personFlags]
stringValue] <<<<< Crashes HERE
forProperty:kABPersonFlags];
Why are you setting a string in that property? Remove the -
stringValue and change the +numberWithInt: to +numberWithInteger:
and it ought to work.
Well I was under the impression that all the property values you get
back form valueForProperty where strings. I stand corrected. It works
great now.
Thanks much.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden