Technical Q&A QA1746

Implementing optional methods of the IKImageBrowserItem Protocol

Q:  I have implemented the optional imageSubtitle method of the IKImageBrowserItem Protocol, but it is not being called. Is there something else that needs to be done for this method to be invoked?

A: You must enable the cell's subtitles using the setCellsStyleMask method:

- (void)setCellsStyleMask:(NSUInteger)mask

This method defines the appearance style of the cells. The mask parameter is an integer mask of the cell appearance styles (shadow / outline / title / subtitle). The mask for subtitles is IKCellsStyleSubtitled. You must specify this mask in order for the subtitles to appear. Here's an example usage:

Listing 1  Setting the appearance style of the cells.

#import <Quartz/Quartz.h>

IKImageBrowserView *imageBrowser = <#Your IKImageBrowserView instance#>;
[imageBrowser setCellsStyleMask:IKCellsStyleTitled | IKCellsStyleOutlined 
                         | IKCellsStyleSubtitled];


Document Revision History


DateNotes
2011-07-22

New document that shows how to implement optional methods of the IKImageBrowserItem Protocol.