0

I've seen many people post about modal view controllers and their sue but so far nothing that specifically fits my case.

I've created a TabBarController application and I wanted to load the app with a login modal view (just a basic subclass of the UIViewController). My goal is that when the 'login' button is pressed, the modal view is dismissed.

I'm able to load the modal view, but when I go to dismiss it, nothing happens. both the calls to display and dismiss the modal view are run from the app delegate.

I will post some of my code later if needed but I didn't have access to it at the time I wrote this, but if anything stands out from what I've just described please let me know, this problem is driving me crazy!!

Y2P
  • 111
  • 1
  • 1
  • 5
  • does the method actually get called? you should try to call it from the modal view itself, and call it on the parent. something like self.parentViewController dismissModalViewController: called from the modal VC (when you want to dismiss it obviously) should work. – Jesse Naugher Apr 06 '11 at 13:25

1 Answers1

2

You can use the dismissModalViewControllerAnimated-method to dismiss the view.

Use [self dismissModalViewControllerAnimated:YES]; in the IBAction.

Joetjah
  • 6,292
  • 8
  • 55
  • 90
Chetan Bhalara
  • 10,326
  • 6
  • 32
  • 51
  • I had the same problem with [self.navigationController dismissModalViewControllerAnimated:YES]; This did the trick. – esbenr Oct 20 '11 at 11:16