202
votes
12answers
89k views

Passing Data between View Controllers

I'm new to iOS and Objective-C and the whole MVC paradigm and I'm stuck with the following. I have a View that acts as a data entry form and I want to give the user the option to select multiple ...
15
votes
3answers
18k views

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

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 ...
44
votes
7answers
40k views

Container View Controller Examples

Can anyone point me to any good examples of creating a Custom View Controller as a Container View Controller? The only documentation I can find is a couple of paragraphs in the UIViewController Class ...
25
votes
5answers
8k views

How to constrain autorotation to a single orientation for some views, while allowing all orientations on others?

This question is about iOS device rotation and multiple controlled views in a UINavigationController. Some views should be constrained to portrait orientation, and some should autorotate freely. If ...
4
votes
4answers
6k views

NSInvalidArgumentException - receiver has no segue with identifier

I have been trying everything for hours, and nothing's worked. I am trying to segue between two view controllers, from one tableViewController to another tableViewController. The segue is hooked up to ...
52
votes
1answer
34k views

Storyboard - refer to ViewController in AppDelegate

consider the following scenario: I have a storyboard-based app. I add a ViewController object to the storyboard, add the class files for this ViewController into the project and specify the name of ...
19
votes
2answers
7k views

Are viewDidUnload and dealloc always called when tearing down a UIViewController?

I'd like to know whether or not both viewDidUnload and dealloc are always called in succession in the UIViewController tear-down process. Is it possible that dealloc could be called on my view ...
30
votes
4answers
94k views

Present and dismiss modal view controller

Can anyone give me the example code that I can use to first present a modal view controller, then dismiss it? This is what I have been trying: NSLog(@"%@", blue.modalViewController); [blue ...
8
votes
6answers
9k views

Supporting both iOS 6 and iOS 5 autorotation

Can anyone confirm that to support both iOS 6 and iOS 5 there is no point to adding the new iOS 6 autorotation methods, since the Apple docs suggest that these methods are completely ignored if you ...
7
votes
4answers
8k views

Application windows are expected to have a root view controller at the end of application launch warning

I have been stuck with this warning for several hours now. I've looked around SO for answers, attempted all the ones I found and couldn't find the solution. Here's the run-down of the code I have, ...
5
votes
2answers
2k views

UILabel updating stops during scrolling UIScrollView

I have a scrollView with an imageView inside of it. The scrollView is a subView of the superView, and the imageView is a subView of the scrollView. I also have a label (at the super-view level) that ...
2
votes
3answers
2k views

UIViewController subclass can't assign instance variable

This is utterly baffling to me, making me think I've missed something essential. But I'm trying to create a view controller container to manage two panes (similar to a SplitViewController but with ...
15
votes
5answers
11k views

How do I share an object between UIViewControllers on iPhone?

My application is a tab bar application, with a separate view controller for each tab. I have an object in my first view controller (A) which contains all my stored application data (Please ignore ...
15
votes
4answers
12k views

When should I initialize a view controller using initWithNibName?

When should I use init: and when should I use initWithNibName:bundle: when creating a view controller?
13
votes
2answers
22k views

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

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 ...

15 30 50 per page