Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Application Development in iOS 7
  • Table Of Contents Toc
Application Development in iOS 7

Application Development in iOS 7

By : Kyle Begeman
4.7 (3)
close
close
Application Development in iOS 7

Application Development in iOS 7

4.7 (3)
By: Kyle Begeman

Overview of this book

Table of Contents (15 chapters)
close
close
Application Development in iOS 7
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1
Index

Displaying data


With our data loaded, we can now display the data in our custom cell. Scroll down to cellForRowAtIndexPath and let's set up our cell.

First, we need to grab the current food item from our array. We will do this using the indexPath.row parameter passed to cellForRowAtIndexPath. Add the following line of code below our cell allocation and before return cell:

// Create an instance of the current food item
NSDictionary *currentFoodItem = self.myFoodsArray[indexPath.row]; 

Now that we have currentFoodItem, we can start assigning our custom cells properties. Let's begin with the image. Add the following code to cellForRowAtIndexPath:

// Grab the image from the current food item and set the cell image
UIImage *foodImage = [UIImage imageWithContentsOfFile:currentFoodItem[@"image_filepath"]];
cell.foodImageView.image = foodImage;

Here, we simply allocate an image based on the image_filepath key we created for each food item. Next, we set this image as the current cell's image. Now, we...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Application Development in iOS 7
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon