uiviewcontroller

Invoke method in another class

I have two view controllers (viewControllerA and viewControllerB) with their own views. When the user touches a button in the view of viewControllerA, I am able to load the view of the viewControllerB. However, I don't know how to invoke a method in viewControllerB's class! ...

possible to release viewcontroller.view without releasing viewcontroller?

I have a viewcontroller which can't be released since it is a subclass with extra functionality... Anyway there are many of them, and I need the views to be released when they go offscreen. removeFromSuperView vanishes the views but they remain in memory. The only way I can get rid of the view from memory is to completely dealloc it. ...

Multiple UIViewController woes...

I'm relatively new, embarking on my second app, and having major pains with multiple view controllers. I've added the relevant bits of code to the bottom of this email. Here's what's happening: MainViewController: creates RoomViewController, then asks for its view RoomViewController: sets up the room with the items in it (in this case,...

iPhone Development - Setting up a view in a view controller

Hi, I'm learning to develop for iPhone without Interface Builder (a personal preference), and I'm not sure which function of a view controller I should be setting up the view in: init, viewDidLoad, or loadView. I read somewhere to only use init for the view controller, if anything, and not setting up the view as it could cause problems. ...

Objective C - UINavigationViewController memory releasing.

First of all, i have never seen so many memory issues in my app since i started placing "self" everywhere after reading an article about how memory behaves in obj-C. Now, im getting all kinds of issues (reveals the sloppiness of my coding). Granted I am a newbie at Objective-C, i'll admit i have never had so much issues with memory manag...

iPhone Dev - Multi-View App lazy loading

(Just so you know I am learning to develop for iphone, without interfacae builder) I'm coding my first multi-view app, which has a root viewcontroller and two other viewcontrollers, and the root viewcontroller uses lazy loading, so when viewDidLoad, it creates the first viewcontroller and adds its view to the subview, but doesn't create...

iPhone Dev - keeping interface rotation

(Just so you know ,I'm learning to develop for iPhone without Interface Builder) I have an app with a root view controller, a blue view controller and yellow view controller. The root VC lazy-loads the blue and yellow VC's and displays the blue VC's view first, and then switches to the other one when a button in the toolbar at the bottom...

Release for controllers and views

If I have a set of custom UIViewControllers that I release in a high level application "restart" routine, would a good way to release their views be to set self.view = nil; in the dealloc method? ...

iPhone Dev - Where to put lazy loading code

I already had a question like this, but I already deleted it anyway. I have very simple app that has a root view controller and it switches between two other view controller views. So in my root view controller, It lazy loads the instances of the two other view controllers. Each time the switch button in the toolbar is pressed, the curr...

Accessing a TabBarItem from within one of the ViewControllers

Hi there, i'm searching for a way to disable a TabBarItem from within the ViewController of one of the TabBars Tabs. I'm even not sure if this is about the View Hierarchy or what to really search for. I tried a lot but didn't come up with a solution. Right now I worked arround it by saving a reference to the tabbar in a singelton objec...

What are some of the possible causes of a UIView rarely not being rotated when revisited?

I put this code into all of my viewControllers: UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIInterfaceOrientationLandscapeRight) { CGAffineTransform transform = self.view.transform; // Use the status bar frame to determine the center point of the window's con...

UINavigationBar tintColor does not always propagate to UIBarButtonItem objects

Greetings! I have set my UINavigationBar's barStyle to UIBarStyleBlack, and the tintColor to a color (other than black so as to get the color/gradient going). That much works well. Now ... let's say I push a new view controller onto the nav controller stack. In this particular VC, I want the nav bar to turn black, but only within this V...

Error while adding array to tabBarViewController.viewControllers

here is the code I am referring to: NSArray *views = [[NSArray alloc] initWithObjects:addPVC, nil]; UITabBarController *aTBC = [[UITabBarController alloc] initWithNibName:nil bundle:nil]; self.initialTBC = aTBC; initialTBC.viewControllers = [NSArray arrayWithObjects:aController, aController2, nil]; [self.view addSubview:initialTBC....

pushViewController for same instance - only for animation purpose

Hi there, I am having single table view in a view controller. That table view lists the countries first. When I click on a country(row), it has to push the same view controller's view with cities under that country. I need to see the slide animation, which we usally get while pushing views in navigator. Is it possible to use the pushVi...

Communication from child UIViewController to parent UIViewController

Hello, I haven't figured out that yet: I have a mainViewController that switches two views, viewControllerA and ViewControllerB. The way I switch the view is by having a UIButton (mainButton) in the mainViewController, and clicking on it switches viewControllerA <--> ViewControllerB. Now here is my problem. My ViewControllerA has a UIB...

Can a UIViewController add itself to a UINavigationController

I'm starting an app where I'd like to have multiple view controllers. Some of the views will be displayed inside of a navigation controller. I can create a navigation controller and then add another instantiated view controller to it. But what I'd like to do, is just instantiate a view controller that has its own view and is the root ...

How do I add UIBarButtonItems to a UIViewController.toolbarItems property using Interface Builder?

I'm trying to use Interface Builder to add UIBarButtonItems to the toolbarItems property of the UIViewController. I have a .xib file and the File's Owner is typed as a subclass of UITableView controller ("ServerTableViewController"). I've dragged a bunch of UIBarButton items into the .xib file thinking that they will show up as part of ...

iPhone subview design (UIView vs UIViewController)

I'm designing a simple Quiz application. The application needs to display different types of QuizQuestions. Each type of QuizQuestion has a distinct behavior and UI. The user interface will be something like this: I would like to be able to design each type of QuizQuestion in Interface Builder. For example, a MultipleChoiceQuizQuesti...

UIViewController manual instantiation within application delegate

I'm just starting iPhone development (coming fron a .Net world) and have been going through many "Hello World" applications to get the hang of this new development platform. One area I have been confused with is the instantiation of a view controller. On an Apple "Hello World" tutorial, they start by creating a Window Based App, which by...

iPhone Dev - UIView frame and loadView

I'm learning to develop for iPhone (programmatically, I don't like IB). I only use IB for the frames of things, so I design in IB but only use it to check each control's frame. Something I've gotten very confused about is the frame of a UIView. First of all, if you do not implement loadView in a view controller, it automatically creates ...