viewcontroller

Why won't this code load my NIB/XIB

I have 2 XIBs with their corresponding View Controllers. Will call them MainViewController and AboutViewController. The names of the XIBs are exactly the same as the names of the ViewControllers. Upon a button click in the MainViewController, I want to show the AboutViewController. I have code like this in the MainViewController: - (...

modal view not showing inside didfinishpickingimage

Hi, I have a viewcontroller, and I would like to display a modal view controller with : presentModalViewController when a user finished picking an image. The modal view controller is working fine when I call it from a button in my main view. But when I call it from didfinishpickingimage callback nothing happens. Thanks. ...

Accessing pushViewController's methods from popViewController

Hi All, I am working on a view based application. In this i have two viewcontrollers. They are: Rootviewcontroller and Detailviewcontroller. Now i am passing a values to Detailviewcontroller using pushViewController method.It works fine. But now when i pop out from this Detailviewcontroller i should access myfunction in Rootviewcontrol...

How to resume view stack of iphone application

Hi, We are implementing one web based application in iPhone. if i answered the incoming phone call my application is relaunching once again instead of resume the application to the state where it last the focus. we are implementing stack of views. I.e i am maintaining views in a stack manner and each view has the information like ima...

Looking for concept for managing game level views, level selection views, preferences view, storing levels, environment variables.

I'm developing a puzzle game application - watch on youtube - for iPhone, and the actual "in-game" part is almost done. It is a separate Class (subclass of UIView) what initializes with a puzzle clue, puzzle pieces, and is ready to send a message for somebody if the puzzle has solved ("completeness" check invoked on every touchesEnded). ...

Take a random Number from one ViewController and use it in a second ViewController - Update

Hi, I have two ViewControllers: The RedButtonViewController and the TweetViewController. The RedButtonViewController generates random numbers in Textlabels and I want to use the number or the label with the TweetViewController. How can I make this? Thanks for your help! My TweetViewController will be opened with this code in the RedBut...

Is it wrong to use viewController.view = newView instead of [viewController.view addSubView:newView];

Is it wrong to use viewController.view = newView; instead of [viewController.view addSubView:newView]; The first removes the additional level of the viewControllers automatically created view, and if I create newView like this UIView *newView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; or like this UI...

How can I update a view in the iPhone every time just before the view is displayed?

I have an application which has 7 tabs with associated views and view controllers. I need a way to update each view when it is selected. I have searched and searched, but cannot find a way to do this. viewDidLoad will not work, as that only is fired the FIRST time a view is selected. Capturing the selected tab in didSelectViewContro...

Setting ViewController delegates in iPhone runtime

I am writing an iPhone application and needed to use the address book functionality. For this to work, it is necessary to specify a ABPeoplePickerNavigationControllerDelegate on the ViewController. The problem is that I am creating all fields and buttons dynamically runtime, and thus does not have any custom ViewController - using only ...

After UIViewController viewDidLoad where do I write code?

I'm new to iPhone dev, I'm wanting to start a loop that checks for user input, but the main hook into the program I've written needs to be instantiated and started, I thought viewDidLoad would be the appropriate place to place the code for my sub view controller. But the actual backgroudn of the VC doesnt get displayed until viewDidLo...

iPhone Calling View Controller Method from UITabBarController Selection Crash

I have a tab bar set up which I would like to call a refresh method from a view controller each time that view controller is tapped. However, when I try calling this method from the App Delegate it crashes on a line in the refresh method containing a string from the view controller. I figure that if I'd be able to call the shouldSelectVi...

best-practices for displaying new view controllers ( iPhone )

I need to display a couple of view controllers (eg, login screen, registration screen etc). What's the best way to bring each screen up? Currently for each screen that I'd like to display, I call a different method in the app delegate like this: Code: - (void) registerScreen { RegistrationViewController *reg = [[RegistrationViewContro...

remove a presentModalViewController

hi , i have posted how to show a modalViewController but now i need to remove it and come back to my tabbarController with the view he was. thx ...

iPhone - Switch Tab from UIWebView

I have a webview and I want to manually switch to another tab during a specific event. The event is arbitray, but I can't figure out hwo to switch teh tab. On my other views, I have the following code: self.tabBarController.selectedViewController = [self.tabBarController.viewControllers objectAtIndex:2]; However, this does not work in...

How to get the cell.textLabel.text from the selected cell in DetailViewController?

I've got a UITableView with several entrys, and these are divided up in several sections. If I click on one of the cells, a DetailViewController is accessed. In that DetailViewController, I want to use the data from the selected cell (the cell.textLabel and the cell.detailTextLabel), but I can't access these. Is there a possibility to so...

iPhone TabBarController - set selected tab programmatically

I have two tabs in my app, each of them is a UITableView, and each of the views in the two tabs has its own DetailViewController. Now, if I click on a TableViewCell in the DetailViewController in the first tab, I want to jump to the DetailViewController of the second tab. I know how to access the second tab self.tabBarController.se...

Problem with iPhone shakes: viewDidAppear isn't called when loading viewController

I'm trying to detect a shake on the iPhone device, so for what i've read I need to set my view controller as first responder on the viewDidAppear method. This method is supposed to be called automatically, but for some reason this method is never called. Only viewDidLoad is called. this is my code (I put only the relevant parts): Build...

displaying viewcontroller modally

I have navigation controller with 2 view controllers. VC1 calls VC2. Based on button selection VC2 displays VC3 modally. After the display VC2 dismisses VC3. Here is my piece of code. VC3 has an imageview. Inside VC3 I have logic to display the image based on button selection in VC2. Could it be done in a better way (like moving all t...

UiTabBar with more than 5 tags

Hi all . I have a tabbar with more than 5 view controllers. Iphone adds a 5th tab ,called 'MORE'. But as much as i've researched, i can't find a way to rename it to the Spanish version, "MAS". Anyone can help ? Thanks. ...

Convert Xcode view-based app to navigation-based app?

Newbie question: is there an easy way to convert a view-based app to a navigation-based app? I have an existing app sample that was created as a view-based app, and need to be able to create additional viewcontrollers that can be nested. The app is currently using presentModalViewController calls and nibs to display windows. Trying to ch...