When I open a custom UIView from a UITableViewController, how do I close the custom view and go back to the table view?


When I open a custom UIView from a UITableViewController, how do I close the custom view and go back to the table view?



I'm using a UITableViewController for a menu in a game. The table view opens a a view controller for my custom UIView that shows the game. When the game finishes the UIView is notified (which is kinda ruining the MVC principals) and from there I am kinda lost.

Questions:

  1. Can a UIView communicate with its controller? How?
  2. Can one controller talk to the one that started it? How?
  3. How do I transition between all of this complicated web of views and controllers gracefully?

How is layoutIfNeeded used?

1:

Login / Logout on an iPhone app
  1. Use a delegate protocol here. Count the number of times a method is called in Cocoa-Touch? Your custom game UIView must use a delegate property and call methods on this delegate when events appear (game over, game paused, view closed, etc). Scrolling to range in UITextView Here's a great post on using delegates: How did I create delegates in Objective-C?. should we need to release viewcontroller's object after pushing into navigation controller?
  2. I'd recommend using a UINavigationController. scrollview scrolls smooth in simulator but not in device? You don't necessarily need to show the navigation bar, although if you nest your view controllers in a navigation controller you have access to -pushViewControllerAnimated: and -popViewControllerAnimated: which make it really easy to navigation between levels of nested view controllers.. Can we run Java applictions on iPhone? [closed]
  3. Ananother benefit of UINavigationController - you'll receive a nice slide animation when you switch between views.. What's a Java alternative to Google App Engine for developing iPhone Push Notification services?
There are another 3rd party mechanisms out there this you may prefer over the UIKit UINavigationController/UIViewController mechanisms. Check out the Three20 project, in particular the TTNavigationCenter class..


66 out of 100 based on 71 user ratings 226 reviews