• 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
ABMutableMultiValue error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ABMutableMultiValue error


  • Subject: ABMutableMultiValue error
  • From: Steven Crosley <email@hidden>
  • Date: Wed, 23 Jan 2008 08:44:38 -0600

Hi,

I'm getting an error when trying to modify a textfield that is attempting to change the value of the main phone number label in address book:

ABMultiValueCoreDataWrapper removeValueAndLabelAtIndex:]: unrecognized selector sent to instance

I get this error when I use either the removeValueAndLabelAtIndex: or the replaceValueAtIndex: withValue: methods. Here's the code that I'm using:

- (void) setMainPhoneNumber: (NSString*) newMainPhoneNumber
{
ABAddressBook *book = [ABAddressBook sharedAddressBook];
ABPerson *person;
ABMutableMultiValue *phone;
int i;
person = (ABPerson *)[book recordForUniqueId:[self uid]];
phone = [person valueForProperty:kABPhoneProperty];
for (i = 0; i < [phone count]; i++) {
if ([[phone labelAtIndex:i] isEqualToString:kABPhoneMainLabel]) {
//[phone replaceValueAtIndex:i withValue:newMainPhoneNumber];
[phone removeValueAndLabelAtIndex:i];
}
}
[phone addValue:newMainPhoneNumber withLabel:kABPhoneMainLabel];
[person setValue: phone forProperty: kABPhoneProperty];
}


Any help would be appreciated.  Thanks!
Steven


_______________________________________________

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


  • Follow-Ups:
    • Re: ABMutableMultiValue error
      • From: Johan Kool <email@hidden>
  • Prev by Date: Re: Get font name and size chosen
  • Next by Date: Get font name and size chosen - Got it
  • Previous by thread: Re: Get font name and size chosen
  • Next by thread: Re: ABMutableMultiValue error
  • Index(es):
    • Date
    • Thread