Now that we have defined the interface and some stub methods for browsing our Pictures
folder, we can continue to complete the implementation by coding the methods required to implement the desired behavior.
When a
BTSImage
object is created, it must be initialized with anNSURL
. We accomplish this by implementing the method namedinitWithURL:
using the following program code, which simply assigns theNSURL
passed to the method to the instance variable.// Assign an NSURL to the BTSImage // and return the BTSImage object - (id)initWithURL:(NSURL *)a_URL { self = [super init]; if (self) { // Initialization code here. m_URL = a_URL; } return self; }
The
IKImageBrowserView
objectdataSource
protocol will invoke a method on our object to determine how we have selected to represent the image. Because we are using anNSURL
to represent our images, we can simply return the constant...