Exception on selecting photo from popoover


I implemented the popover (just the first part) as explained in the book. The popover appears, shows photos etc. but as soon as I select one I get an exception

I tried running under iphone simulator, and it works fine.

Strange - thought i’d done something wrong, but then I downloaded the solutions from website, and ran chapter 13 solution, with exactly the same results. As soon as I select a photo, I get an exception that it’s trying to insert a nil value. But only on ipad version. Any ideas?


I’ve traced my program and the problem is in popoverControllerDidDismissPopover

that works, and if I step through I can see image having a value.

as soon as I hit the next line CFUUIDRef newUniqueID = CFUUIDCreate (kCFAllocatorDefault); image is nilled. No idea why. Anyone?

If i run same trace in iPhone simulator, it breezes past that line…
(I’m testing this all in the sample code to make sure it’s not something silly I’ve done…)


and I should have tried this first. deleted app from simulator, cleaned project and re-started xcode and now it’s working fine.