uiviewcontroller

UITabBarController View Position and Size

I have a UITabBarController that adds a viewController, but the positioning is off. There is about a 20px gap at the top of the screen and the bottom of the loaded viewController is hidden. How do I move resize the loaded viewController? viewController = [[FlashCardViewController alloc] initWithNibName:@"FlashCardViewController" bun...

Setting the size of a UIView

Hi there, I have a UIViewController subclass to control a UIView that I want to add to a UIScrollView. I only want the view to be 100px high, but when I add it to the scroll view it gets made 460px high, ignoring the frame size I set: MyViewController *vc = [[MyViewController alloc] init]; vc.view.frame = CGRectMake(0, 0, 320, 100); my...

Changing Views In TabBarController

I have a TabBarController with 4 viewControllers - one of them is called FlashController. From within the FlashController.m code, how do I switch to one of the other controllers in myTabBarController? Is there a way to access FlashController's container or parent? The TabBarController is not referenced anywhere in the FlashControlle...

IPhone - Which View Controller methods to use

I'm trying to figure out what logic should go into the different UIViewController methods like viewDidLoad, viewDidAppear, viewWillAppear, ... The structure of my app is that I have a root view controller that doesn't really have a view of its own, rather it has a tab view controller and loads other view controllers into it. But in the...

Get to UIViewController from UIView on iPhone?

Is there a built-in way to get from a UIView to its UIViewController? I know you can get from UIViewController to its UIView via [self view] but I was wondering if there is a reverse reference? ...

Orientation Change needed but only for one of several views in TabBarViewController

My App has a UITabBarController with five tabs. I needed to rotate orientations only for the fifth tab. I was able to get all five to rotate to landscape by subclassing the UITabBarController @implementation TabBarControllerRotate (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { //return ...

Can't populate object property in uiviewcontroller on iPhone

I have a uiviewcontroller with two properties: trackName and playerObject. PlayerObject also has a trackName property. I call this uiviewcontroller from my main uiviewController with this code: SecondaryViewController *nextViewController = [[SecondaryViewController alloc] initWithNibName:@"SecondaryViewController" bundle:nil]; NSStrin...

remove viewController from a window iPhone

I have following code in my Application. Comments in my code will specify "My Question". - (void)applicationDidFinishLaunching:(UIApplication *)application { tabBarObj = [[UITabBarController alloc] init]; vctr0=[[SplashScrn alloc] initWithNibName:@"SplashScrn" bundle:nil]; vctr1=[[SearchViewController alloc] initWithNibName:@"Sear...

How to launch iPhone Camera on viewDidLoad?

I can't seem to launch the camera when loading my view. I end up making the user have to find and press a button on the screen just to load the camera (redundant). How can I do this? Code follows: // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { self.imgPicker = [[U...

How to re-load UIView after memory unload?

My main view controller (representing the Main Menu in my app) has a simple UIView with a few sub views. I am using a modal-type design pattern and switch to multiple other view controllers before finally returning to the main menu. The problem is, in my other view controllers (not the main menu one), I often load data-heavy images and t...

UITabBarController UIViewController View with TabBarCtrl doesn't appear in my ViewCtrl :(

I have MainController class for UITabBarController's view managing. When I try to display my TabBarController from ViewController - it display clear screen. :-( I could display my TabBarController only from __AppDelegate. =) How can I display TabBarController from my UIViewController based view? =) Please help me guys. Thank you a lot...

pushView - set Longger time - iPhone

I have following code in my application. [self.navigationController pushViewController:x animated:YES]; It will push a new view to the application. I want to change the animation time for pushing. What should I Do? ...

UIViewController not working for the first time

MyController *myViewController = [[MyController alloc] initWithNibName:@"myView" bundle:nil]; The nib file myView.nib has 2 uiimageviews and 2 uilabels. When I first init myViewController, all the 4 subviews are set as 0x0. The second time I dont get such a behavior. ...

presentModalViewController issues: Newbie needs help

Hi guys, I have a UIViewController (which sits inside a tabUIController). Within this UIViewController, I want to present a modelviewcontroller when a user clicks on a button. I cannot get this to work. With the code I have (see below) i get to the stage where i press the button but i get the strange error of "unable to read unknown loa...

Is there a way to catch an WillRotateToInterfaceOrientation event from an UIView?

Hey, every UIViewController has a method called willRotateToInterface. Is it possible to do this within a UIView too? Does this match the idea of model view controller ? The only way I can think of is to send the event from the UIViewController to the UIView. Is there a global variable for the current orientation? ...

Touch events not working on UIViews inside UIScrollView

Hi there, I have a series of UIViews inside a UIScrollView, and the UIViewControllers for those views are not receiving the touch events. If I take the views out of the scroll view then it works. I have enabled userInteraction on the views but it's still not working! This must be possible and I'd be really grateful if someone could po...

iphone how to check the type of an Object ?

HI , i am new to iPhone. i want to check the type of an Object. how i will do that ... the scenerio is i m getting an object . if that object is of type A then do something .. if it is of type B then do something .. currently the type of the object is C that is parent of A and B ... i have two classes AViewController and BViewControll...

Setting property value of parent viewcontroller class from child viewcontroller?

Does anyone know how to update a property value from the subview (child) view controller? I have a int property called statusid defined with gettor/settor in parent view controller. [self.view addSubview:detailsVC.view]; In the child subview, I trying calling [super statusid:updatedValue]; to update statusid to a new value, but this cre...

Hitting buttons while UIView is in transition, flipping in or out...

My son just discovered that he could hit my view's "Done" button, which flips to the previous view, once to start the flip and one or more times as the view is in transition (flipping out). The second and next hits would trigger the same action over again, creating some interesting results, such as ending up with no views visible, but m...

Difficulty with apps with a forced landscape orientation

I have two apps, both of which force the user to use the iPhone in landscape mode, in order to have a wider screen, instead of a taller one. One of the things I have found is that my first view will look fine, but all other views come up with their subviews (UIButtons, UIPicker, UIViews) squeezed to one side or clipped (depending on whe...