Pg 245 Crash on iPad 1st Generation


#1

I am up to page 245 of this book, and it seems as if I’ve hit an issue with the takePicture method. The book lists the first command within the takePicture method as the following:

However, I am getting the following exception when running this on my 1st generation iPad (no camera):

2012-02-04 23:45:37.766 Homepwner[16258:f803] UIStatusBarStyleBlackTranslucent is not available on this device. 2012-02-04 23:45:37.769 Homepwner[16258:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'On iPad, UIImagePickerController must be presented via UIPopoverController' *** First throw call stack: (0x13c1052 0x1552d0a 0x20e227 0xd73d988 0x5483e 0x5e6d1 0x544bb 0x544bb 0x50c72 0x55a4f 0x4f72b 0x294ec6 0x294ccb 0xf12b7 0xf13df 0xeed9b 0x105441 0x1054f9 0x2fcc68 0xbc4a1 0xbd12b 0x2fc4c7 0xe5427 0xe558c 0xe55cc 0x4b29 0x13c2ec9 0x1b5c2 0x256d54 0x13c2ec9 0x1b5c2 0x1b55a 0xc0b76 0xc103f 0xc02fe 0x40a30 0x40c56 0x27384 0x1aaa9 0x12abfa9 0x13951c5 0x12fa022 0x12f890a 0x12f7db4 0x12f7ccb 0x12aa879 0x12aa93e 0x18a9b 0x27db 0x2785) terminate called throwing an exception(gdb)

I don’t recall ever calling UIStatusBarStyleBlackTranslucent in the code, so I’m not sure if that’s something I’m doing wrong, but if we’re not supposed to call UIImagePickerController when running on the iPad, shouldn’t this be changed in the first line of this method?