uiviewcontroller

How to know when UIView becomes completely hidden?

I am switching between two views by toggling hidden attributes. How would I know when one view gets hidden and/or visible? Tried setting break points into viewDidLoad, viewDidUnload, viewWillAppear, viewWillDisappear, viewDidDisappear, becomeFirstResponder and resignFirstResponder. Nothing. None of those are called, when I set hidden = ...

MKMapView will not accept an annotation

This is hard to explain so bear with me ... I'm using an example that I know works. It's the MapMe chapter from the Apress More iPhone dev book. I'm using the same code but I've created a MapViewController class to contain all the map code and am inserting the view from the nib as a subview of my MainViewController view. With me? My pr...

ABPeoplePicker Delegate pattern question

I have a subclassed UIViewController that's acting as an ABPeoplePicker Navigation Controller Delegate. This view controller calls this ABPeoplePicker in a few different situations and the problem I'm having is figuring out which situation I'm responding to in - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController...

How to test UIViewControllers at build time?

I'm a big believer in testing, but not a very good practitioner. I've done pretty well at getting coverage on my model objects and programming them in a TDD style. I'm actually enjoying it so much I'd love to extend this to my controller layer, particularly my UIViewController subclasses. Unfortunately, many UIKit classes don't function...

How to Notify View Controller that a Property of an Object has Changed

Hello all, I have a view controller which gets an NSObject conforming to a protocol and then displays a view with the object's properties. The question : How can my controller know that a property of this object has been modified and then refresh the view ? Thanks a lot Thierry ...

viewDidAppear & viewWillAppear not firing in tabbar app

In a tab bar application, I'm adding a view to my first tabbar view by doing: [self.view addSubview:anotherView.view]; Once anotherView is done, I do: [self.view removeFromSuperview]; Which goes back to the parent but doesn't fire viewDidAppear or viewWillAppear on the parent. I can use messaging but it seems there must be a b...

How to get UIViewController of a UIView's superView in iPhone SDK?

Hello all, I have a UIViewController in which i have a UITextView added from interface builder.Now i want to push a view when i click on hyperlink or phone number. I am able to detect that which url is clicked using a method i found in stackoverflow. Here is the method @interface UITextView (Override) @end @class WebView, WebFrame; @pr...

Iphone ARKit -trying to get the demo to work using a ViewController rather than just using the Delegate

I've been playing around with ARkit [http://www.iphonear.org/][1] ARKit comes with a demo project that implements everything in the AppDelegate and does not make use of separate ViewController files. I have been trying to get the demo to work using a ViewController rather than just using the Delegate. Has anyone done this successfully...

UIToolbar on each page of UINavigationController

I have an application which runs on a UINavigationController. Now I would like to add a UIToolbar element to the bottom of each screen. The Toolbar on the bottom should the be customizable for the ViewController that is currently being displayed. My first idea was to simply add the toolbar to the navigationController view and tag it, in ...

iPhone - Quit Tab when Switching

I have a tab based application with 3 tabs. How do I go about completely closing the view controller of a specific tab when it is switched? It should start again when it starts again. Thanks for the help. ...

iPhone - Handling Memory with Multiple Views

Hi, Here is a piece of code from the exploring the iPhone SDK book. It uses the example of 2 views. It checks to see which view is being used and will release the other one. - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Releases the view if it // doesn't have a superview // Release anything that's ...

How to handle multiple views

Im trying to develop a multi view apllication while trying to avoid navagation controllers as apple recommend this for the iPad. My problem is nav controllers are the only way I know how to make a multiview app, does anyone have a link to code or a book I could look at that show other ways? I already have exploring the iphone sdk and th...

How to correctly detect touches in my UIView ?

Hello guys, I'm having a problem. I have a UIView, that looks like this : In that view controller I implemented the "touchesBegan:withEvent:" method, but the method is only getting triggered when I touch the bar at the bottom of the view , nothing happens when I touch the table. How could I change this behavior to be able to detect t...

iphone basic release question

Hi, When i add a new subview, i cant immediately release the controller after displaying. How should i release this viewController? I was thinking about using a property for the viewController, and use delegation to notify for removing the view and releasing it? Is this the best way to do it? or should i do something with autorelease?...

Peform selector when ViewController gets shown?

Hi! I'm loading a view controller like this: [self presentModalViewController:webViewController animated:YES]; It works but when I call it a second time the view is the same (of course). I need to perform a selector after the modal view controller gets visible again. How can I do this? Thanks Philip ...

Navigation bar not displaying

In a tab bar based app, I add a new UIViewController from tabview1 like this [self.view addSubview:self.aView.view]; I created the nib for aView in IB. It is a view with a tableview and navigation bar. I have aView and bView, which are nearly the same and added to the parent the same way. The only difference is that aView has two s...

One Root view controller , Manages all other views?

Hi guys, I was just wondering if its normal for an app to a have one root view controller which gets passed other view controllers and switches betwen them ? - in other words there is one view controller which switches between all other views. So one root controller manages all the other views ( so in a large application for the sake o...

How can I add a startup sound when UIViewController *controller is initiated?

ViewDidLoad doesnt work. ViewDidappear Doesnt work. No matter what happens, the sound is played then the viewController image is displayed. What I want is the image to be displayed, then the sound plays simultaneously' ...

iPhone: How I can Access Data in a View Controller Class from Another Controller Class?

Hey , In my application I have one Entry form in which there are six Text fields Name :UITextField Date of Birth :UITExtField Age:UITextField Address :UITextField Phone No :UITextField Image : UIIMageView Now What I want is that I want all these fields value in the same fields of other ViewController class. How it could be possible ...

2 UIView, one single Controller

Hello, I have an application composed of a main view and a secondary view which is used to define parameters used by the first view. Both views have their own .xib . In order to simplify the management of the application, I Would like to have the same controller (same class ans same instance) for both views. How can achieve this? Tha...