O'Reilly logo

Mac Application Development by Example Beginner's Guide by Robert Wiebe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – implementing the methods for browsing our Pictures folder

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.

  1. When a BTSImage object is created, it must be initialized with an NSURL. We accomplish this by implementing the method named initWithURL: using the following program code, which simply assigns the NSURL 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;
    }
  2. The IKImageBrowserView

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required