Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 8: Programming Basics in Objecti... > Finishing the MyBookstore Program

Finishing the MyBookstore Program

With the understanding of instance variables and properties, we are going to now venture forth to create the actual bookstore program. The idea is simple enough—create a class called Bookstore that will be stocked with a few Book objects.

Creating the View

Let’s start by first getting our view ready. If you need a refresher on how to build an interface in Xcode, please refer to Chapter 6.

  1. Click on the DetailViewController.xib file in the Navigation Window. This will display Xcode’s interface builder, as shown in Figure 8–8.
    images

    Figure 8–8. Preparing the MyBookstore detail view.

  2. Simply delete the existing control that is just a placeholder for the detail view. We’re going to add some new fields to display some details about a selected book. Since we deleted this control, we also need to remove the code that references it.
    1. In the DetailViewController.h file, remove the following line:
      @property (strong, nonatomic) IBOutlet UILabel *detailDescriptionLabel;
    2. In the DetailViewController.m file, remove the following line near the top of the file:
      @synthesize detailDescriptionLabel = _detailDescriptionLabel;
    3. In the DetailViewController.m file, in the method named configureView, remove the following line:
      self.detailDescriptionLabel.text = [self.detailItem description];

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial