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
Wayne Knoesen
9,435 PointsdismissModalViewControllerAnimated deprecated
Hi All,
Im doing the Delegation Tutorials for iOS and I seem to have hit a snag with the awesome Puns app.
Everything was going super well untill I was was trying to dismiss the modal that I used to enter a new pun and rating into.
Im using Xcode 5 and I am told that dismissModalViewControllerAnimated is deprecated.
It seems like I could used this
[self.navigationController dismissViewControllerAnimated:YES completion:<^(void)completion>];
However I have no idea what to use for the <^(void)completion#> Any ideas forum?
Thanks Wayne
2 Answers
Stone Preston
42,016 Pointsthat allows you to specify a completion block to run when the view controller is dismissed. You dont have to specify a block. You can just leave it blank.
Wayne Knoesen
9,435 PointsThanks, I actually thought it was creating a bug where I was unable to add the pun to the list. However after searching around I saw that I had not given the segue the identifier in the storyboard.
As I newbie I thought that I was supposed to move the adding of the pun to the list into that completion block since it seemed to want to run something there.
I have seen the error of my ways :-)