uiviewcontroller

UINavigationController - send selector to current view?

Hey. I have a reload-button in my UINavigationController that is supposed to send a reload-selector to the current loaded view, or the view on top, I don't know what to call it :p I have no idea where to start, so if someone could give me a pointer (no, not that kind :p), that would be great :) Thanks! ...

UIViewController loads rotated to landscape but only supports portrait

Is there a way to load a portrait only view controller in portrait orientation even though the parent view controller (and phone) is in landscape orientation? This particular UIViewController only fits in Portrait mode (it's a color picker), so the code in shouldAutorotateToInterfaceOrientation: returns YES only for portrait orientatio...

Mixed type iPhone project(navigation and opengl es)

I would like to have the menu part of my game a navigation style application, customized as I want. Then when the player starts the game it should load the game and run like an opengl es application. How is this done? is it 2 types of apps joined? Im thinking keeping all the xib files for the menus etc. but I am not sure how to connec...

iPhone - Handle touch slide in a UIViewController

Hi, I'd like to handle touches (horizontal slide in particular) in a UIViewController subclass I did, but the problem is the controller's view contains a UIScrollView which covers the whole screen, so "touchesBegan:" and "touchesEnded:" events are never called in my controller. The scrollview only scrolls vertically. What would be the ...

What Method is used to identify when the user switches views in a tabview controller

I am working on my first simple tabview controller app. The first tab is a setup tab, and I just had a tester provide an unexpected use case. In order to address this use case, I need to execute when the user is leaving the view and before I load the next one. Running code in the next view is too late. What method is called from the c...

iPad - UIViewController only kinda rotates

Alright, so here's the problem I'm having (it's a weird one.) I added a new UIViewController for the app I'm building. The first view controller works perfectly, orients correctly, etc. The second one orients horribly. This is how it looks if you start in landscape and then change orientation to portrait: And then, if you start in p...

UIScrollView with Paging and new View Controllers

Hello, I currently have an app that has a UIScrollView with paging as the primary ViewController. However, currently, I am trying to animate to a new ViewController, but whenever I use presentModalViewController or an animation using UIView, I am still able to scroll, left and right on the original view. I was successfully able to ke...

Wheres the best place Iphone app to place a Data Model instance and how would you Access it?

Hey guys! I am learning tons on this thing. Reading also, but this is awesome! Ok.. so long story sort I hope. I'm making a data class to pump out some instances of people that have various attributes. I would like my view controllers to be able to access them (through properties of course.. I think) to manipulate their data. Where in...

Is it possible to add navigation controller to a view controller?

Hi all , My app have AppDelegate ----> added MyViewController.view MyViewController contains UINavigationController, i.e. MyViewController.view = MyViewController.aNavigationController.view With this I able to see the added view correctly Then I created a NextViewController Added one button to MyViewController with action On bu...

ViewController and drawRect

Hello, I have a UIViewController and I would like it to call drawRect so i can draw on the view but nothing happens. #import <UIKit/UIKit.h> @interface ViewController : UIViewController { ...code... } @end and the implementation #import "ViewController.h" @implementation ViewController -(void) drawRect:(CGRect) rect { draw a po...

Calling function in the first view from the other viewcontroller

Hello everyone, I hope that you will succeed in at least a little to clarify me how and what to do, I'm sure I'm wrong, so I really need an expert opinion. I have two viewcontroller together with nibs what I want is to call function that is in first class from another ViewController, the problem is that another viewcontroller manages to ...

Switching images from an array in an iphone app

I was helped here a while ago about loading images from an array, but would like to know the exact details please. Where does the code go if my app will be as simple as images that load from an array depending on whether the user chose the next or previous button? Does it go in the View Controller class? What do I need if I literally j...

Shared View Controller access to model class

Hi, I am trying to keep close to the MVC approach to programming in an objective C application. I have a model class and two View Controllers. @interface Disc : NSObject { NSString *discType; NSNumber *capacity; } @property (nonatomic,retain) NSString *discType; @property (nonatomic,retain) NSNumber*capacity; @implementation Dis...

bounds versus applicationFrame

why do I see in some sample code from Apple (PhotoScroller) that do the following in loadView: CGRect frame = [[UIScreen mainScreen] bounds]; instead of CGRect frame = [[UIScreen mainScreen] applicationFrame]; Does it make a difference between the two to get the mainscreen frame? ...

Help Creating multiple views with view controllers

Ok here is what i am trying to do. In my root view controller I have the main view and then inside that view, i have three additional views. (note this is for the ipad). Here is what I want to do. When the root view loads i want it to load the other three views as well and all have their own view controller. Here is what I have attem...

Fix UIScrollView to pass events UP the chain rather than DOWN

UIView's that don't handle their events pass them up the chain. By default, this passes them to their parent View, and if not handled (ultimately) to their parent UIViewController. UIScrollView breaks this (there's lots of questions on SO, variations on the theme of "why does my app stop working once I add a UIScrollView?) UISV decides...

View Controllers in iOS

How does the application identify the primary view controller, to pass messages like shouldAutorotateToInterfaceOrientation ? ...

Making sure that objects in nibs are initialized before applicationDidFinishLaunching

Hello, and thanks for taking a look at my problem. i have two view controllers in my app and each has its own nib file. an instance of controller1 is stored in MainWindow.xib and an instance of controller 2 is in Controller1.xib. is there a way to make sure that controller 2 is initialized before the app delegate is sent applicationD...

iPad Contacts application like layout

I am trying to create an iPad application which needs a layout similar to contacts app. I want to have two views side by side controlled by two different view controllers. I was considering using SplitViewController, however as I found out, there is no official way too keep root view from hiding (keeping views side by side like contacts ...

Stacked modal UIViewControllers don't animate as per doc?

In short, I have a root controller RootController presenting a modal navigation controller showing Controller1, which itself presents a modal navigation controller showing Controller2. I want to dismiss Controller1 and Controller2 at the same time by sending the root controller a dismissModalViewControllerAnimated: message. I expected ...