uiviewcontroller

Problem working with NSMutableArray to store objects other than just strings in UITableViewController

I am a novice using iPhone SDK and Objective C. I am facing a stupid issue with the NSMutableArray object. I have a Team class and a Player class. Team class has an NSMutableArray object that holds the Player objects. Team class is initialized with initWithTitle:(NSString*)title constructor. Player has Name property. Now, I have a simp...

Release in viewDidUnload and dealloc both?

I have been under the assumption for a while that viewDidUnload is always called when a controller is deallocated. Is this a correct assumption? I've just been exploring some odd things, and set a breakpoint in my controller's viewDidUnload and it's dealloc. It appears that dealloc is called, but the viewDidUnload method is never call...

Best practice for ownership of a UINavigationController in a navigation based app?

Hi all My small app is growing more sprawling and I'm looking for some best practice advice on the management/ownership of view controllers and navigation controllers. Here's what I'm doing now: AppController is a singleton that creates and owns a UINavigationController instance. The app controller, and thus the navigation controller,...

iPhone: How to Pass Data Between Several Viewcontrollers in a Tabbar App

Hello guys, I have following problem: I have built a tabbar application with 4 tabs. I want to pass a object/variable from the first tab controller to the third one and initialize this controller with the corresponding object. I've already done some research. The best way, corresponding to a clean model approach, would be to call som...

iPhone: View that is a Property Fails to Appear after Adding a @synthesize Directive for the Property.

I have a mainwindow.xib which has a tabbar controller. The first tab bar has a view, that loads from "View1.xib". In my View1.xib, I drag the UI element on it. It has this in .h: #import <UIKit/UIKit.h> @class View1Controller; @interface View1Controller : UIViewController { IBOutlet UIView *view; IBOutlet UIButton *startButton...

UITableViewController back button must be pressed twice?

Hey all, i simple open a UITableView with [self.navigationController pushViewController:memberView animated:YES]; The View opens correctly, but if i press the back button only the text changed from "Back" to "Profile" which is the Title of my originally view, another button click navigates back as expected. It seems to me that the m...

How to get a UIViewController from a UIView via code

Guys, There is a way to get a view controller reference from a UIView object? I need something like this: MyParentViewController *myParentViewController = [self.view.superview controller]; Thanks in advance. ...

iPhone app architecture

Hi all, considering good design, is it better for each view controller to manager their own connection / networking / loading, or to centralize it in the app delegate, or a separate object? Context: I have a multi-tab app, each with a navigation controller, and a number of view controller below. Each view controller is doing networ...

How to generically handle class objects that differ only by initialized properties?

I like the idea of abstracting CellControllers in a heterogeneous UITableView as suggested by Matt Gallagher. However in the case of typical push-detail-view behavior, I find myself creating nearly-identical variants of LinkRowCellController that differ only by the detail view controllers' init methods -- init:, initWithBook:, initWithMa...

iPhone initializing a UIViewController with additional data

Hi guys, I have a custom UIViewController subclass, which gets pushed on a UINavigationController stack. I want to add some data of my own at the time of initialization/pushing. Should I a) write a custom init method with my data as argument, like this? MyCustomViewControllerSubclass.m: -(id) initWithNibName: bundle: myCustomData: {...

iPhone - UITextField not set to editable programmatically when using modal dialog?

Hello, I am kinda new with iPhone development and I'm having a bit of trouble with an apparently very simple thing. - (IBAction) addButtonPressed:(id) sender { AddDrinkViewController *addDrinkVC = [[AddDrinkViewController alloc] initWithNibName:@"DrinkDetailView" bundle:nil]; UINavigationController *addNavCon = [[UINavigationContr...

[iPhone] Howto switch between UIViewControllers without using a tab bar?

Hi all, I have a UINavigationController. In the 2nd level of my hierarchy, I want to show a view controller with a toolbar in which I inserted a segmented control. Through it the user can select between two "views" of the same page that we can call A and B (like in the Calendar application). When the user press the A segment, the A vie...

Calling a function from a different view controller for iphone

Hi All, I have a problem where I want to call a function defined in one view controller from another controller. I'v try what seems llke a hundred different setups and nothing seems to work. I've posted the basic code and was hoping someone could tell me how they would do it. Basically all I want to do is call the MYBPress function defi...

Current UIView Questions iPhone SDK

I posted earlier but am running into similar problems again. Basically the way that my app is setup there is a top bar that is basically just a static image that has UIButtons placed on top of it. That is the Main View Controller and is persistent no matter what view is shown beneath it. I can't use a navigation controller because it is ...

How do I reload a tableView contained within a UIViewController?

I want to reload the data within a table view that is contained on the root view of my application. The root view of my application (called RootViewController) is a UIViewController that has a corresponding NIB file. I added a UITableView component to the RootViewController.xib via IB. In the header file RootViewController.h I ensure Ro...

How to use generic (NSObject) controller with subviews of a UIViewController?

I have a UIViewController that is loading several subviews at different times based on user interaction. I originally built all of these subviews in code, with no nib files. Now I am moving to nib files with custom UIView subclasses. Some of these subviews display static data, and I am using loadNibNamed:owner:options: to load them int...

How to recreate UIViewController stack?

I'm writing a 'load' feature for my current iPhone app. Practically what I want to do is get the user back where s/he left off. To do so I want to recreate all the UIViewControllers appeared before. My problem is the UIViewControllers won't appear if I simply call [[self navigationController] pushViewController:newController animated:Y...

Cocoa Touch : A method each time view is shown?

hi, there is a method called viewDidLoad that execute a code when the view is loaded is there a method that do the samething but each time the view is shown? ...

navigationController will/did ShowViewController - How to tell which?

Given the UINavigationController delegate methods: -(void)navigationController:(UINavigationController*)navigationController (will/did)ShowViewController:(UIViewController*)viewController animated:(BOOL)animated How do you tell or compare which view controller instance is relevant to the event? I am developing an app that renders tou...

iPhone: How to Trigger the Loading of a View Using a UI Element in a Previous View

I've been reading the Head First iPhone Development book and I understand how to get to a new view from a table but how exactly would I be able to get to a new view or view controller, by just simply pressing a button? Is that even possible? I mean there are some apps where you click a button, not a table cell and it loads a new view. ...