Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Christian Idylle
Christian Idylle
5,583 Points

UIImagePickerController view always reappears after picking an image

I'm following the videos step by step and at stage 4, Capturing Photo and Video using UIImagePickerController I run the simulator then tap on camera tab which I then pick a photo. After selecting a photo the view is dismissed, however unlike what is shown in the video, the image picker instantly reappears again. It seems it has to do with the fact that after the image picker is dismissed (in didFinishPickingWithInfo) the viewWillAppear method is called again when the Recipients tabviewcontroller is shown again.

Why is it that in the video when the user taps the image picker is not shown again? I followed pretty much the code line by line.

Any help will be appreciated.

1 Answer

Hey christian,

you simple have to dismiss the picker, i Don't know what video that is from but the code i used in my project was,

[picker dismissViewControllerAnimated:YES completion:nil];

this should solve it, if it doesn't let me know.

Happy hacking Kai.