iOS Programming: The Big Nerd Ranch Guide, 3/e

iOS Programming: The Big Nerd Ranch Guide, 3/e

Author:Hillegass, Aaron & Conway, Joe [Hillegass, Aaron]
Language: eng
Format: mobi
Tags: COM051370, Big Nerd Ranch Guides, iPhone / iPad Programming
Publisher: Pearson Education (US)
Published: 2012-03-13T16:00:00+00:00


UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];

[item setThumbnailDataFromImage:image];

Now that BNRItems have a thumbnail, you can use this thumbnail in ItemsViewController’s table view. In ItemsViewController.m, update tableView:cellForRowAtIndexPath:.

[[cell valueLabel] setText:

[NSString stringWithFormat:@"$%d", [p valueInDollars]]];

[[cell thumbnailView] setImage:[p thumbnail]];

return cell;

}

Now build and run the application. Take a picture for a BNRItem instance and return to the table view. That row will display a thumbnail image along with the name and value of the BNRItem. (Note that you will have to retake pictures for existing BNRItems.)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.