uiviewcontroller

UIViewController: set self.view to my view or add my view as subview?

Hello, I have a question about UIViewController's subview, I created a UIView subclass MainView, which has the exact size of the screen, I wonder which is a better way of adding MainView, consider the following factors: 1 As MainView has same size as the whole screen, the MainView itself may have subviews, but there is no views at the s...

pushViewController doesn't do anything on didSelectRowAtIndexPath in UITableView

I have a UITableView and I have set up didSelectRowAtIndexPath, which gets called (I have verified it using NSLog) every time user clicks on a row. However, I want to reload the same view and change a different data. For example, I am displaying content of a directory on a remote web server, and as soon as user clicks on the row, I want...

Custom UITabBarController Problems with View Controllers and Views

Hi there, I'm writing a custom UITabBarController so I can fully control appearance of the tab bar. I've got it all working so I have an array of view controllers that it handles. The controller has a main view which fills the screen, and inside it it has a UIView at the bottom for the tab bar. That tab bar view has a button for each v...

iPhone - insertSubview makes ObjectAlloc jump

Whenever I add a new viewController my ObjectAlloc jumps up really high and never comes back down. Even after calling removeFromSuperview. Is this normal? if((UIButton *) sender == gameArcadeBtn) { GameArcade *gameArcadeController = [[GameArcade alloc] initWithNibName:@"GameArcade" bundle:nil]; self.gam...

Xcode: When is a View Controller added to the stack of views?

Is a view controller added to the stack of view controllers at the #import line of the root view controller? Is this where indexPath gets the info about the view controllers? I've read documentation and seen tutorials, but this aspect still isn't clear to me. I'm been learning Xcode/Obj-C for 4 months now. Thanks, Steve ...

Reloading a UITableView on a UIViewController

I have a view controller set up as follows: UIViewController In IB I have set set a UITableView to have the File's Owner (the UIViewController) be both its delegate and data source. When I Build & Go, I can trace the table view methods (for sections and rows) being called so the connections seem to be OK through the view loading. But...

iPhone - dealloc subview UIViewController when removeFromSuperview

I have several buttons on my main UIViewController (main menu) that creates and adds a subview UIViewController on top of the main menu. When I remove the subview the memory from that controller is not released. How can I release that subviews memory instantly? Does anyone have an example? This would solve all my problems! Thanks in...

iPhone - Multiple UIViewControllers Release

My main UIViewController, (PMGameViewController.h), is the file which my apps delegate calls. There are several buttons on my main UIViewController (PMGameViewController.m). When a button is pressed I do an insertSuvbiew and attach another UIViewController on top. When the mini game is over I simply do a removeFromSubview. This rem...

Dismiss ViewController from TableViewController

I have presented the viewController which contains a navigation controller whose view is loaded from another nib with the UITableView in it. I would like to dismiss that presented viewController from the UITableViewController. I have tried every combination of self.parentViewController and self.navigationController and self.navigationCon...

UIViewController - can't become first responder

Hi, anyone knows why UIViewController wouldn't become first responder when I run this code: [self becomeFirstResponder]; NSLog(@"is first resp: %i",[self isFirstResponder]); In the console, I always see the line: "is first resp: 0" I HAVE canBecomeFirstResponder method: - (BOOL)canBecomeFirstResponder { return YES; } I don't even ...

iphone app with multiple views/subviews: memory is not being deallocated

Hello I have an iPhone application that loads succesive views in a framework based on the one explained in this link (basically a main ViewController that loads/removes additional views with a displayView method). In my application I am using NIBs (the example link uses coded views) though so each of my ViewControllers has its accompany...

How to add an UIViewController's view as subview

I have a ViewController which controls many subviews. When I click one of the buttons I initialize another viewcontroller and show it's view as the subview of this view. However the subview exceeds the bounds of the frame for subview and infact fills the entire screen. What could be wrong? I presume the problem is that UIViewController'...

presentModalViewController from UIView

Hi Everyone: I am attempting to call presentModalViewController on a UIViewController in order to bring up a Address Book "view", however I am running into a bit of a problem. The UIViewController that "controls" the app simply draws a view to the screen and then lets the view do all of the handling of user interaction, etc. But now, ...

a way to set the size for my UIViewController

Hello all I was wondering if there was a way to create some sort of frame for the UIViewcontroller for instance like so ( i know it doesn't work) : UIViewController *example = [[UIViewController alloc] initWithFrame:CGRectMake(0, 0, 320 , 55)]; a bit like the UIWebview UIWebView *aWebView = [[UIWebView alloc] initWithFrame:CG...

Add toolbar to UITableViewController

What is the simplest way to add UIToolBar to UITableViewController? I'm depending on edit functionality, so I can't change UITableViewController to UIViewController easily. ...

touches in touch event handling in UIView vs UIViewControllers

So, I'm capturing multiple touches and determining the number and where each of the touches occurred and I'm seeing different behavior between a UIView UIViewController. Basically, the event handler is coded below: (in this case the touchesEnded, but it really doesn't matter). What happens in the View, is that I get the entire collect...

View controller not getting -shouldAutorotateToInterfaceOrientation: messages on second load?

I have a UIViewController that I'm using to control a "pop-up" view for viewing images throughout my application. It supports autorotation, as it automatically sizes the image to fit properly regardless of orientation. This works perfectly, but only the first time I initialize and display the view controller. When it closes, I am remo...

Conditionally hide UINavigationBar in a UIViewController

I'm using a UIViewController containing a UIView and a UINavigationBar on which there is two buttons (Cancel on the left, Save on the right). This UIViewController is presented on the screen like this on top of a Tabbar based application: [self presentModalViewController:(UIViewController *)myUIViewController animated:YES]; This wor...

iPhone Dev: Views not fitting in my UINavigation Controller

I don't use IB much for creating my views, so I usually do everything programatically. I'm bascially pushing a viewController to a navigation controller and it seems the top part of the viewController is under the navigation bar. I'm trying to make the view fit correctly. Here is my code: navigationController = [[UINavigationControlle...

UIView continues to exist after removeFromSuperview

I add a firstView in the AppDelegate : #import "TestViewAppDelegate.h" #import "MainViewController.h" @implementation TestViewAppDelegate @synthesize window; @synthesize mainViewController; - (void)applicationDidFinishLaunching:(UIApplication *)application { MainViewController *aController = [[MainViewController alloc] initWit...