Search Results

Search found 528 results on 22 pages for 'viewcontroller'.

Page 4/22 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Returning back to the viewController with segues

    - by umar
    This is my Hierarchy Navigation Controller --> Login Controller View --- > Register Controller View --> My Small Internal LeaderBoard View Now I am using segues (Push) to go to either LoginControllerView or LeaderBoardView Once I am on LoginControllerView and then RegisterControllerView I am using this code [self dismissViewControllerAnimated:YES completion:nil] However instead of returning me to LoginControllerView it is returning me back to NavigationController. How can I return to my LoginController

    Read the article

  • best-practices for displaying new view controllers ( iPhone )

    - by Tristan
    I need to display a couple of view controllers (eg, login screen, registration screen etc). What's the best way to bring each screen up? Currently for each screen that I'd like to display, I call a different method in the app delegate like this: Code: - (void) registerScreen { RegistrationViewController *reg = [[RegistrationViewController alloc] initWithNibName:@"RegistrationViewController" bundle:nil]; [window addSubview:reg.view]; } - (void) LoginScreen { LoginViewController *log = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil]; [window addSubview:log.view]; } It works, but I cant imagine it being the best way.

    Read the article

  • Convert XCode view-based app to navigation-based app?

    - by Wally
    Newbie question: is there an easy way to convert a view-based app to a navigation-based app? I have an existing app sample that was created as a view-based app, and need to be able to create additional viewcontrollers that can be nested. The app is currently using presentModalViewController calls and nibs to display windows. Trying to change these to pushViewController calls results in the views not being displayed. So I'm assuming it's because the pushViewController needs to use a Navigation view. Thanks in advance!

    Read the article

  • How return a value from view2 to view1 when using navigation bar

    - by Anil Kumar
    Hi All, I am New to the iPhone Development. How can i carry a string value from view2 to view1 when using navigation bar. I have no problem in carrying string values from view1 to view2 to view3 to....by using pushviewcontroller But when i come back to previous views using Back button of navigation bar, I cannot able to hold string values. I need your help in solving this issue. Thanks In Advance

    Read the article

  • iPhone - Switch Tab from UIWebView

    - by user269737
    I have a webview and I want to manually switch to another tab during a specific event. The event is arbitray, but I can't figure out hwo to switch teh tab. On my other views, I have the following code: self.tabBarController.selectedViewController = [self.tabBarController.viewControllers objectAtIndex:2]; However, this does not work in my custom UIWebView class. Is there a simple solution to this? Thanks

    Read the article

  • How do I create a view with a picker on the bottom and a table view on the top?

    - by Andy
    Hi - first time asker, long-time lurker. I am trying to create an iPhone view that has a date/time picker on the bottom half of the screen, and a grouped, single-section, four-row table view on the top half of the screen (almost identical to the one Apple shows in Fig. 2-4 of their View Controller Programming Guide (but then never goes on to explain). Conceptually, I think I understand that what I need is a main view with a pair of subviews - one for the picker, and one for the table view. I'm pretty sure I can make the picker function once I have it on-screen, and I'm pretty sure I can make the table view function too. What I can't for the life of me figure out is how, programmatically speaking, to get the two views onto the screen simultaneously. I can lay it out perfectly in Interface Builder, but then it all goes to hell when I switch to Xcode...the view appears with the picker, but no table view. Thanks, in advance, for any help you can offer.

    Read the article

  • Knowing which annotation is selected and accessing properties of it.

    - by kevin Mendoza
    So far my program can display a database of custom annotation views. Eventually I want my program to be able to display extra information after a button on the annotation bubble is clicked. Each element in the database has a unique entry Number, so I thought it would be a good idea to add this entry number as a property of the custom annotation. The problem I am having is that after the button is clicked and the program switches to a new view I am unable to retrieve the entry number of the annotation I selected. Below is the code that assigns the entry Number property to the annotation: for (id mine in mines) { workingCoordinate.latitude = [[mine latitudeInitial] doubleValue]; workingCoordinate.longitude = [[mine longitudeInitial] doubleValue]; iProspectAnnotation *tempMine = [[iProspectAnnotation alloc] initWithCoordinate:workingCoordinate]; [tempMine setTitle:[mine mineName]]; [tempMine setAnnotationEntryNumber:[mine entryNumber]]; } [mines dealloc]; When the button on an annotation is selected, this is the code that initializes the new view: - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { mineInformationController *controller = [[mineInformationController alloc] initWithNibName:@"mineInformationController" bundle:nil]; controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:controller animated:YES]; [controller release]; } and lastly is my attempt at retrieving the entryNumber property from the new view so that I can compare it to the mines database and retrieve more information on the array element. iProspectFresno_LiteAppDelegate *appDelegate = (iProspectFresno_LiteAppDelegate *)[[UIApplication sharedApplication] delegate]; NSMutableArray* mines = [[NSMutableArray alloc] initWithArray:(NSMutableArray *)appDelegate.mines]; for(id mine in mines) { if ([[mine entryNumber] isEqualToNumber: /*the entry Number of the selected annotation*/]) { /* display the information in the mine object */ } } So how do I access this entry number property in this new view controller?

    Read the article

  • how do I get the program to Know which annotation is selected and be able to access properties of it

    - by kevin Mendoza
    So far my program can display a database of custom annotation views. Eventually I want my program to be able to display extra information after a button on the annotation bubble is clicked. Each element in the database has a unique entry Number, so I thought it would be a good idea to add this entry number as a property of the custom annotation. The problem I am having is that after the button is clicked and the program switches to a new view I am unable to retrieve the entry number of the annotation I selected. Below is the code that assigns the entry Number property to the annotation: for (id mine in mines) { workingCoordinate.latitude = [[mine latitudeInitial] doubleValue]; workingCoordinate.longitude = [[mine longitudeInitial] doubleValue]; iProspectAnnotation *tempMine = [[iProspectAnnotation alloc] initWithCoordinate:workingCoordinate]; [tempMine setTitle:[mine mineName]]; [tempMine setAnnotationEntryNumber:[mine entryNumber]]; } [mines dealloc]; When the button on an annotation is selected, this is the code that initializes the new view: - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { mineInformationController *controller = [[mineInformationController alloc] initWithNibName:@"mineInformationController" bundle:nil]; controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:controller animated:YES]; [controller release]; } and lastly is my attempt at retrieving the entryNumber property from the new view so that I can compare it to the mines database and retrieve more information on the array element. iProspectFresno_LiteAppDelegate *appDelegate = (iProspectFresno_LiteAppDelegate *)[[UIApplication sharedApplication] delegate]; NSMutableArray* mines = [[NSMutableArray alloc] initWithArray:(NSMutableArray *)appDelegate.mines]; for(id mine in mines) { if ([[mine entryNumber] isEqualToNumber: /*the entry Number of the selected annotation*/]) { /* display the information in the mine object */ } } So how do I access this entry number property in this new view controller?

    Read the article

  • How to debug memory allocation issues?

    - by amitabh
    Hi I am writing an iPhone app that that is trying to create a second a view when the user clicks on an element in UITableView. The code looks like ReplyToViewController *reply = [[ReplyToViewController alloc] initWithNibName:@"ReplyTo" bundle:nil]; reply.delegate = self; Message *message = [resultData objectAtIndex:indexPath.row]; int dbid = [message.bizid intValue]; NSLog(@"dbid=%d",dbid); reply.currentMessage = message; reply.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:reply animated:YES]; The reply object gets created properly and the view is proper. Last line in above code segment calls some framework code which eventually calls the viewDidLoad method of the ReplyToViewController. Address of the reply object in the above code and the address of the object in viewDidLoad is not same. Any idea where this new object is coming from? How do I debug? I also added init method the following method in ReplyToViewController hoping that it will get called and I can find who is creating this new object. But it does not stop in this method. Any help will be greatly appreciated. - (id) init { /* first initialize the base class */ self = [super init]; return self; } // Following gets called from the 1st code segment. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; NSLog(currentMessage.text]; // THIS returns nil and the program fails later in the code. }

    Read the article

  • How do I load a second view correctly in Swift?

    - by slooker
    I have a view that I'm trying to load in Swift like this, but it crashes with this error: 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "DetailView" nib but the view outlet was not set.' Here is the code I'm trying to use to load it. Second View Controller import UIKit class DetailViewController: UIViewController { @IBOutlet var nameField: UITextField override func viewDidLoad() { super.viewDidLoad() } } Code to load the view controller: var newViewController = DetailViewController() @IBAction func buttonTapped(AnyObject) { println("button tapped!") self.presentViewController(newViewController, animated: true, nil) } What am I doing wrong?

    Read the article

  • How do I get a reference to a rootViewController to a sub-view?

    - by Andy
    An answer posted for one of my previous questions brings up another question; I am calling a new view controller, "RuleBuilder," from my rootViewController. The rootViewController holds a reference to a contacts array. How do I get a reference to that array into the RuleBuilder? I tried adding UITableViewController *rootViewController; ... @property (nonatomic, retain) UITableViewController *rootViewController; to RuleBuilder.h, and then @synthesize rootViewController; in RuleBuilder.m. When I instantiate and push the RuleBuilder from within rootViewController, I do this: ruleBuilder.rootViewController = self; But when I try this [rootViewController.contacts addObject:newContact]; from within RuleBuilder, I get a compiler error to the effect of "request for 'contacts' in something not a struct" (or very similar; I haven't implemented this exact snippet of code, but I tried an identical approach not an hour ago for a couple of different references that I never was able to get working). Thanks, again, for your help.

    Read the article

  • How can I pass information between 2 different View Controllers?

    - by sagiftw
    Hi, This is a simple question: I have 2 different view controllers, and each one has its own data stored in its .m file. I want to take a value, for instance, an integer value (int i=3;) that is declared in ViewController1 and pass it to ViewController2, so I will be able to use that value in the second view controller. Can anyone please tell me how to do it? Thanks in advance, Sagiftw

    Read the article

  • How to load different XIBs for different device orientations for same viewcontroller?

    - by Jaanus
    The documentation says that if I want to support both portrait and landscape, I basically have two ways of doing that: Set up the viewcontroller's view so that the subviews autoresize correctly and make smaller changes programmatically at runtime If the changes are more substantial, create an alternative landscape interface and push/pop the alternative modal viewcontroller at runtime I would like to present the info where the layout is substantially different, but logic is the same. Ideally, I would load another XIB for the same viewcontroller, but it does not seem to be an option. Sounds like #2 is what I need to do, but my problem with that is that it sounds like it would use the standard modalviewcontroller animations that are nothing like the device rotation animation. (Of course, being the lazywebber that I am, I did not test this hypothesis.) So, how do I load an alternative layout for landscape with the same viewcontroller but different XIB? Should I use the method #2 above and is the rotation animation natural? Or is there some other way?

    Read the article

  • How can I know which viewController is being displayed(in view) currently by my appdelegate?

    - by wolverine
    I am doing a normal viewBased application and have added another viewController(along with the xib). When the application starts, normally it will display its own view. I am doing an action and is going to another viewController class. From this class, I want to check which viewController is being displayed currently in the view. How can I do this? Does anyone have an idea?

    Read the article

  • Observing MVC, can/should the Model be instantiated in the ViewController? Or where?

    - by user19410
    I'm writing an experimental iPhone app to learn about the MVC paradigm. I instantiate my Model class in the ViewController class. Is this stupid? I'm asking because storing the id of the Model class, and using it works where it's initialized, but referring to it later (in response to an interface action) crashes. Seemingly, the pointer address of my Model class instance changes, but how can that be? The code in question: @interface Soundcheck_Tone_GeneratorViewController : UIViewController { IBOutlet UIPickerView * frequencyWheel; @public Sinewave_Generation * sineGenerator; } @property(nonatomic,retain) Sinewave_Generation * sineGenerator; @end @implementation Soundcheck_Tone_GeneratorViewController @synthesize sineGenerator; - (void)viewDidLoad { [super viewDidLoad]; [self setSineGenerator:[[Sinewave_Generation alloc] initWithFrequency:20.0]]; // using reference -> fine } // pickerView handling is omitted here... - (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { [[self sineGenerator] setFrequency:20.0]; // using reference -> crash } @end // the Sinewave_Generation class... only to be thorough. Works fine so far. @interface Sinewave_Generation : NSObject { AudioComponentInstance toneUnit; @public double frequency,theta; } @property double frequency; - (Sinewave_Generation *) initWithFrequency: (int) f; @end @implementation Sinewave_Generation @synthesize frequency; - (Sinewave_Generation *) initWithFrequency: (int) f { self = [super init]; if ( self ) { [self setFrequency: f]; } return self; } @end

    Read the article

  • UIPageViewController: How to refer the UIPicker selected Value from 1 Viewcontroller to another...

    - by Abhinav
    I am referring the code from here, please have look at the code while answering my question : http://www.ioslearner.com/wp-content/uploads/2011/12/UIPageViewControllerDemo.zip important notes and few changes: I basically have a viewcontroller and contentviewcontroller . ViewController - have following UIPAgeViewController Datasource and Deligate UIPickerView - upon next and previous page turn the value in the PickerView changes contentviewcontroller - has following UIWebview - defined in Viewdidload of contentviewcontroller which dynamically fetches a html page based upon the string value (LabelContents) sent through following method -(UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController is there a way to populate the UIWebview in contentviewcontroller based upon the row selected in UIPickerView ? Kindly help.

    Read the article

  • iOS : is it possible to open previous viewController after crashing and re-launch app?

    - by Nitin Gohel
    How to achieve this stuff below? Please give me some guidance for it. I describe my issue below. When I tap home button and remove app from tray and while I am opening app I get the login screen. I know how to use NSUserDefaults well. But my issue is that when I navigate 3rd or 4th viewController and I press Home Button and remove app from tray, Then whenever I open app than I want to open with last open viewController. Also same when my app is Crashing and I am opening it again then I want to open app with last open viewController state. So I just want to know that is that possible or not? If yes, then please guide me how to achieve this stuff. Thank you

    Read the article

  • UITabBarController with viewControllers utilizing different orientations?

    - by RickiG
    Hi I can see that this is something that has been troubling a lot of people:/ I have a UITabBarController that has 4 viewControllers, all of type UINavigationController. One of the navigationControllers gets a viewController pushed onto its stack, this viewController should be presented in landscape mode/orientation. The viewController is a graph, it is the absolutely only place in the app where landscape makes sense. (I hide the UITabBar when this is presented to not lead the user to believe this will work everywhere) To make a UITabBarController respond correctly to changes in orientation all its viewControllers need to return the same value from the delegate method: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation So to accomodate this behavior I have implemented this method in all the viewControllers belonging to the UITabBarController: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; BOOL canRotate = [defaults boolForKey:@"can_rotate"]; return canRotate; } The "trick" is now that when my can-be-landscape viewController is pushed I do this: - (void) viewWillAppear:(BOOL)animated { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setBool:YES forKey:@"can_rotate"]; [defaults synchronize]; } and when it is popped, I do this: - (void) viewWillDisappear:(BOOL)animated { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setBool:NO forKey:@"can_rotate"]; [defaults synchronize]; } This works really well. When the viewController is on the stack I can rotate the device and the view follows. The problem is however, that if the user taps the "back" button on the navigationBar while in landscape mode, thus popping the viewController to the previous viewController, this "old" viewController is of course also in landscape mode. To make things worse, because I set the BOOL to NO, this "old" viewController can not rotate back when I orientate the device to portrait mode. Is there a way to update everything so that none of my other viewControllers will be in landscape mode when I pop the can-be-in-landscape mode viewController? I am a bit worried that if this could be done from landscape to portrait it should also be possible from portrait to landscape, thus making my "hack" unnecessary.. but if it can not, then I am back to square one :/ Hope I am close and that someone could help me get there, thanks:)

    Read the article

  • About hide toolbar in iphone app

    - by Jagie
    I have a navigationController which root viewController has no toolbar,but the root viewController navigates to a viewController which has a always visible toolbar.I must assure the root viewController's toolbar is hidden whether it is presented first or its above viewController is poped in the navigationController stack.So,I use the following code in the root viewController: - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.navigationController setToolbarHidden:YES animated:YES]; } is this the best sulotion?or I should use "hidesBottomBarWhenPushed" etc?

    Read the article

  • in iOS7 how do you stop the First viewcontroller autorotating?

    - by uaka
    I have an app that just needs one screen to autorotate, the first and last screens should be portrait. I can get the last screen to stop rotating using: -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } But this does not work on the first screen, I am using a storyboard with a UINavigationController (I'm thinking that may have something to do with it?) Any help would be gratefully received. Thanks

    Read the article

  • Why Does the iPad Main View Refuse to go FullScreen?

    - by dugla
    I am doing an imaging app for iPad and it requires use of the entire screen. The approach I have used on iPhone does not appear to work on iPad. In Interface Builder I have set the UIToolbar to translucent.This code echos the dimensions of the main view before and after requesting fullscreen. (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self.window addSubview:self.viewController.view]; NSLog(@"Hello Popover AD - application did Finish Launching With Options - viewSize: %f %f BEFORE", self.viewController.view.bounds.size.width, self.viewController.view.bounds.size.height); [self.viewController setWantsFullScreenLayout:YES]; [self.viewController.view layoutIfNeeded]; NSLog(@"Hello Popover AD - application did Finish Launching With Options - viewSize: %f %f AFTER", self.viewController.view.bounds.size.width, self.viewController.view.bounds.size.height); [self.window makeKeyAndVisible]; return YES; } This is what NSlog has to say: Hello Popover AD - application did Finish Launching With Options - viewSize: 768 1004 BEFORE Hello Popover AD - application did Finish Launching With Options - viewSize: 768 1004 AFTER Can someone please tell me what I am doing incorrectly here? Note, on iPhone I set fullscreen within the init method of the relevant ViewController. Can view resizing only be done in a ViewController? My ultimate goal is a fullscreen view nicely tucked underneath a translucent status bar and tool bar. I will retract the status/tool bars when user interaction begins in the main view. Thanks, Doug

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >