uiviewcontroller

Why do UIViewControllers get over-released?

On a number of view controllers in my app, it seems to get overreleased such that when I pop the view controller (i.e. the user hits "back"), I get a crash. I am using fairly standard code to declare and load the UIViewController: MyViewController *myVC = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; NSM...

What's the best practice to pass value/parameter between NavigationControllers?

Prior to asking this question here, I have googled aroung. In general, people suggest two ways to pass values/parameters between NavigationControllers: Via properties in the root ViewController Via Data Models I know already that the first choice may not be the best practice. A lot of people seem to adopt this practice. However, I st...

Keeping values between view controllers

I have an ItemAddViewController, which presents itself as a modal view. One of the fields pushes a new view controller, CategorySelectionViewController, which allows the user to select a single category. ItemAddViewController.h @property (nonatomic, retain) Category *category; CategorySelectionViewController.h @property (nonatomic, ...

Why won't my iPad app project "start" in landscape mode out of the box?

This is a weird question inasmuch as I've definitely had projects that work fine, possibly because I've been doing something differently. But now I'm confounded. I create a new View-based iPad app with Xcode (3.2.3 fwiw). This gets me a default view controller with a default view which gets unarchived and displayed at startup. When I ...

How to recreate a UIViewController stack when the root view controller is a UITabBarController?

Hello, guys. I have an app that if it is quit in a certain view, I want to restore this view exactly where the user left. My applicationDidFinishLaunching is very simple at the moment: - (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after app launch [window addSubvi...

How can I determine if a view has been loaded for the first time?

I want to detect the very first time my view is displayed. After that, I wan't to forget about it. Where can I set a BOOL to do this? ...

Switch UIViewController in a Tab Bar Controller Type Application

Hi, Pardon the simple question, but I am pulling my hair out trying to get a grip around navigation in the iPhone. So, I have a Tab Bar Controller type application with UITabBar and 3 UITabBarItems. I have the 1st Tab Bar Item loading a kind of "Home Screen/Welcome", on the Home Screen, there is a button. When the user clicks the but...

MFMessageComposeViewController pushes my view down 20px. Why? How to fix?

Hi all, I have an iPhone app which hides the status bar when run. After launching a MFMessageComposeViewController and dismissing it (after either send or cancel) all my previously drawn elements are shifted down 20px. This is clearly to do with the status bar showing when the MFMessageComposeViewController is presented. Can I either st...

presentModalViewController doesn't rotate properly in iPhone / iPad

Hi all... I have a viewController called MainViewController, which has a UIButton. When tapped, this button loads another viewController, called ModalSelector like this: - (IBAction)showModalSelector:(id)sender { ModalSelector *modal = [[ModalSelector alloc] initWithNibName:@"modalSelector" bundle:nil]; modal.modalPresentationSty...

Displaying CAEAGLLayer in a UIView or CALayer

Hi, Rather new to trying to get OpenGL ES working on the iPhone, but I've created a working demo from an OpenGL template and wanted to add it to another App which is a standard UIViewController App. After searching around it seems that I can't addSubview a CAEAGLLayer to a CALayer aka UIView. How would I go about doing this? Or am I com...

custom UIViewController subview does not rotate but superview does, help me work out why?

Simple iPad app. App loads and displays a UITableView controlled by a subclass of UIViewController. This works and rotates perfectly. Clicking on a row in the table view causes a new subview to be created, also controlled by a UIViewController subclass. This displays fine in portrait but does not adjust to landscape and does not respon...

TableView Does NOT Switch to Detail View When Connected to Tab Bar Controller

Hi, I have created a Tab Bar Application, removed the default FirstView and SecondView and added the following two ViewControllers: JustAnotherView (which is simply a UIViewController with a UIView inside) MyListOfItems (which is a UIViewController with a TableView inside) I have a 3rd ViewController called ListOfItemsDetailViewCont...

UINavigationController: Rotating the view of a covered controller

I have UINavigationController with two view controllers in it (C1 covered by C2). At some point the device is rotated. C2 needs to know the size of one of C1's views (C2 is a map for C1's grid and I need to draw the frame in C2's view). The bounds of C1 are updated when C1 is popped, but I need to get the updated bounds at the time of ...

Adding an image to my UIViewController

Hi, just a quick question here. How can I add an image to my UIViewController. Currently, my view controller has a couple labels and a couple buttons, but I have a file line.jpg that I'd like to add to this view controller as well. And I'd like to add it at a specific location (namely, at the center of the screen). How could I (meaning,...

iPhone - Catch horizontal swipes -before- subview

I have a view, that is able to go back to the previous view. Let's say this is a questionnaire. So my main view is the questionnaireView(Controller), and it has a subview which shows a question with 2 possible answers. When one answers the question, one presses next, and the questionnaireView(Controller) shows the next question in that ...

How to access custom view controllers in Three20 Package in iPhone?

Hi friends, I have implemented three20 projects in my application. And i have createdgrid view(Thumbnail view) and displayed the images using Three20. On clicking it, the selected image will be shown in the next view using TTPhotoViewController. Now i want access my view controller in the TTPhotoViewController class. For Eg, i want t...

How to draw in UIViewController in landscape orientation on the iPhone?

Hey guys, there are already some questions on this topic. Unfortunately none of them helped me in anyway. So here is the thing. I am working on an app atm and it has one tabcontroller with two tabs, which contain multiple navigationcontroller on top of each other. Now in one tab at the top level navigation controller, I want to draw some...

UIViewController background Image

How do I set the background image of my UIViewController? What is the code to do it? Right now I have self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.jpg"]]; but I don't want a pattern. I want it to fill the screen properly. Thanks! ...

Multiple UIViews in a viewcontoller?

hi all, i have a uiviewcontroller. there are 2 buttons at the top of UIview. i want to load 2 different UIViews (small view; width=320, height=200) bottom if the user taps buttons. i have uitableview in each smallview and some controls. thats why i want to handle each uiview with own uiviewcontrollers. i think i should create Uiview wi...

Add extra button to ABPersonViewController

Im working on a small app that displays contact and biography details. You can see two screenshot here: contactDetails, biogDetails. At the moment I have an Action button on the right hand side of the NavigationBar that displays an ActionSheet where the user can perform various actions like: "add to favorites" "update data", "Bi...