| Adopted by | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AddressBook.framework |
| Availability | Available in Mac OS X v10.2 and later. |
| Companion guide | |
| Declared in | ABImageLoading.h |
Implement this protocol to handle images loaded from an asynchronous fetch for ABPerson objects.
A person may have an associated picture or image. The image in not actually stored in the Address Book database (a property list)—it’s stored in a separate image file. These image files may be local or remote. Local images are any images in .../Library/Images/People or images the user has set using the Address Book application. Remote images are images stored on the network. Theses images take time to download, so ABPerson provides an asynchronous API for fetching remote images.
Use the beginLoadingImageDataForClient: method if an image file is not local and you want to perform an asynchronous fetch. You pass a client object that implements the ABImageClient protocol as an argument to this method. The beginLoadingImageDataForClient: method will return an image tracking number. A consumeImageData:forTag: message is sent to your client object when the fetch is done. Implement this method to handle the new fetched image. Use the cancelLoadingImageDataForTag:class method if for some reason you want to cancel an asynchronous fetch.
- (void)consumeImageData:(NSData *)data forTag:(NSInteger)tag
Gets the image data for the given tag that was initiated by an asynchronous fetch. The data argument is set to an NSImage/QuickTime compatible format or nil if no image could be found. The tag argument should have been obtained from a previous call to the ABPerson beginLoadingImageDataForClient: method. In the case of a multi-threaded application, this method is always called on the main thread.
+ cancelLoadingImageDataForTag: (ABPerson)– imageData (ABPerson)ABImageLoading.h
Last updated: 2006-05-23