Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

ABImageClient Protocol Objective-C Reference

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

Overview

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.

Tasks

Loading an Image

Instance Methods

consumeImageData:forTag:

- (void)consumeImageData:(NSData *)data forTag:(NSInteger)tag

Discussion

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.

Availability
See Also
Declared In
ABImageLoading.h

Next Page > Hide TOC


Last updated: 2006-05-23




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice