• 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: Setting company checkbox programatically in an AddressBook
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Setting company checkbox programatically in an AddressBook (From: development2 <email@hidden>)
 >Re: Setting company checkbox programatically in an AddressBook (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Setting company checkbox programatically in an AddressBook
  • Next by Date: Cocoaheads Lake Forest (92630) meeting 11/12/2008 at 7 pm on "Using and optimizing Core Data in a commercial application"
  • Previous by thread: Re: Setting company checkbox programatically in an AddressBook
  • Next by thread: Creating a window when pressing a button
  • Index(es):
    • Date
    • Thread