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: Nick Zitzmann <email@hidden>
- Date: Tue, 9 Dec 2008 14:31:14 -0700
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.
personFlags = (kABShowAsMask && kABShowAsCompany);
That should be one ampersand, not two.
[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.
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