Re: Correct way to get a person in Address Book
Re: Correct way to get a person in Address Book
- Subject: Re: Correct way to get a person in Address Book
- From: "Mike R. Manzano" <email@hidden>
- Date: Tue, 11 Nov 2003 20:16:45 -0800
macABEntry = (ABPerson *) [_macAddressBook recordForUniqueId: abID ];
You have to cast the returned record into a person since a record isn't
derived from a person. Automatic casting only would work if the return
of the method was a person and you were assigning it to a record --
there is no way for the compiler to know that the returned record is
actually a person.
Mike
On Nov 11, 2003, at 6:42 PM, Darwin Zins wrote:
I am new to Objective-C and Cocoa and I have a question. I have the
following code (where abID is an NSString containing the UID):
_macAddressBook = [ABAddressBook sharedAddressBook];
[_macAddressBook retain];
ABPerson * macABEntry;
macABEntry = [_macAddressBook recordForUniqueId: abID ];
Compiling this gives me a warning "assignment from incompatible pointer
type" for the last line. The code actually works, but what is the
correct way to do this?
Thank you,
Darwin
_______________________________________________
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.
_______________________________________________
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.