Search Results

Search found 825 results on 33 pages for 'uiviewcontroller'.

Page 10/33 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Finding related tags using acts-as-taggable-on

    - by user284194
    In tag#show I list all entries with that tag. At the bottom of the page I'd like to have something like: "Related Tags: linked, list, of, related tags" My view looks like: <h2><%= link_to 'Tag', tags_path %>: <%= @tag.name.titleize %></h2> <% @entries.each do |entry| %> <h2><%= link_to h(entry.name), entry %></h2> <%- unless entry.phone.empty? -%> <p><%= h(entry.phone) %></p> <%- end -%> <%- unless entry.address.empty? -%> <p><%= h(entry.address) %></p> <%- end -%> <%- unless entry.description.empty? -%> <p><%= h(entry.description) %></p> <%- end -%> <p2><%= link_to "more...", entry %><p2> <% end %> Related Tags: <% @related.each do |tag| %> <%= link_to h(tag.tags), tag %> <% end %> tags_controller.rb: def show @title = Tag.find(params[:id]).name @tag = Tag.find(params[:id]) @entries = Entry.paginate(Entry.find_tagged_with(@tag), :page => params[:page], :per_page => 10, :order => "name") @related = Entry.tagged_with(@tag, :on => :tags) end Every entry has at least one tag, it's required by the entry model. I'd like duplicate tags ignored and the current tag (the tag that the list belongs to) ignored. My current code displays this: Related Tags: Gardens Gardens ToursGardens Gardens is a link to the entry, not the tag gardens. ToursGardens is a link to the entry that includes those tags. My desired result would be: Related Tags: Gardens, Tours Each link would link to it's associated tag. Can anyone help me achieve this? I tried using a div_for but I don't think that was right.

    Read the article

  • View load methods not firing.

    - by 4thSpace
    I'm loading a view like this: if(commentSubmissionView == nil){ commentSubmissionView = [[CommentSubmissionController alloc] initWithNibName:@"CommentSubmissionView" bundle:nil]; } [self.view addSubview:commentSubmissionView.view]; viewDidLoad and viewWillAppear in commentSubmissionView do not fire. Is there something else I need to do?

    Read the article

  • _resignRootViewController causes app to crash.

    - by RickiG
    [MainViewController _resignRootViewController]: message sent to deallocated instance 0x4ebfe50 This error happens when I try to pop my MainViewController Object from within it self: - (void) switchToTableView { //a method on the MainViewController [self.navigationController popViewControllerAnimated:NO]; [[UIApplication applicationDelegate] switchToTableView]; //convenience method for the app delegate } The debugger stops at the [super dealloc] command in MainViewControllers dealloc method. I do the exact same thing in the TripTableViewController, but here it never crashes. MainViewController and TripTableViewController are handled in my AppDelegate like this: - (void) switchToTableView { TripTableViewController *tripTableViewController = [[TripTableViewController alloc] init]; [[self.navigationController navigationBar] setHidden:NO]; [self.navigationController pushViewController:tripTableViewController animated:NO]; [tripTableViewController release]; } - (void) switchToScrollView { MainViewController *scrollView = [[MainViewController alloc] init]; [[self.navigationController navigationBar] setHidden:YES]; [self.navigationController pushViewController:scrollView animated:NO]; [scrollView release]; } I am trying to achieve that when the user goes from TripTableViewController to MainViewController; TripTableViewController is released/popped and visa versa for the MainViewController. I do not wish for the navigationController to make the decision about when to pop/cache/release them, this is why I try to do it from within it self. I have not been able to find the _resignRootViewController mentioned anywhere. My guess is that it is a delegate message sent by a ViewController that resigns as rootViewController for a navigationController and that somehow it is called twice, once before MainViewCOntroller is released/popped and somehow again afterwards. Have any one else seen this error message before? Google and the Apple Docs does not mention it? How can I debug such an error? Hope someone can guide me in the right direction on this one, Thanks:)

    Read the article

  • modalViewController use very much memory

    - by burki
    Hi! I'm presenting a modalViewController that uses a certain amount of memory, of course. But now, if I call the method - (void)dismissModalViewControllerAnimated:(BOOL)animated it seems that the modalViewController remains in the memory. How can I solve this problem? Thanks.

    Read the article

  • How to load xib file with attached view controller ?

    - by hib
    Hello all , I am using a xib file as a back view in coverflow component . and it is seeing nicely . The code for loading a xib file is : NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"TestMine" owner:nil options:nil]; backView = [array objectAtIndex:0]; Now I want to attach a view controller with this xib without changing the current code . How can I do so ? Tell me if more details need to answer the question . Thanks .

    Read the article

  • iPhone: Push Navigation Controller (w/ TableViewController) onto stack. Is this possible?

    - by Nic Hubbard
    I have a view which contains a UIButton. When this is clicked, it calls a method that loads another NIB. Now, normally, that nib would load a view onto the stack, and everything would be fine. But, I am trying to load a Navigation Controller (so that I can have table views that are multiple levels deep), and all I get it errors. What is the proper method for loading a Navigation Controller and putting it on the top of the stack?

    Read the article

  • Calling a method in a view controller from a view

    - by Lakshmie
    I have to invoke a method present in a view controller who's reference is available in the view. When I try to call the method like any other method, for some reason, iPhone just ignores the call. Can somebody explain as to why this happens and also how can I go about invoking this method? In the view I have this method: -(void) touchesBegan :(NSSet *) touches withEvent:(UIEvent *)event{ NSArray* mySubViews = [self subviews]; for (UITouch *touch in touches) { int i = 0; for(; i<[mySubViews count]; i++){ if(CGRectContainsPoint([[mySubViews objectAtIndex:i] frame], [touch locationInView:self])){ break; } } if(i<[mySubViews count]){ // viewController is the reference to the View Controller. [viewController pointToSummary:[touch locationInView:self].y]; NSLog(@"Helloooooo"); break; } } } Whenever the touches event is triggered, Hellooooo gets printed in the console but the method before that is simply ignored

    Read the article

  • [iPhone] presentModalViewController not working

    - by ryyst
    Hi, here's my code: ViewController *vc = [[ViewController alloc] initWithNibName:@"TableView" bundle:nil]; [self.navigationController presentModalViewController:vc animated:YES]; //[self setView:[vc view]]; If I call it, nothing happens. However, if I change it to: ViewController *vc = [[ViewController alloc] initWithNibName:@"TableView" bundle:nil]; //[self.navigationController presentModalViewController:vc animated:YES]; [self setView:[vc view]]; The view appears just fine (without the transition, of course). What am I doing wrong? Is there anything special you have to take care of when initializing the view controller? I tried to copy as much as possible from Apple's examples, but I can't get this to work... Thanks for any input! -- Ry

    Read the article

  • Can I load multiple UIViewControllers that each kick off their own NSURLConnections?

    - by RexOnRoids
    My Rootviewcontroller uses NSURLConnection to get data from a server, and then, based on this data, loads a bunch (like 7) of smaller UIViewControllers that each also use their own NSURLConnection to get some more specific data from the server. But, the problem is, only the RooTViewController is recieving callbacks from: - (void)connectionDidFinishLoading:(NSURLConnection *)theConnection the other UIViewControllers never get callbacks...

    Read the article

  • View controllers inside tab bar controller not auto-rotating

    - by Padawan
    In an iPad app, I have five regular view controllers (not navigation controllers or anything like that) inside a tab bar controller. The tab bar controller is just a plain UITabBarController declared in the app delegate. All the view controllers return YES in the shouldAutorotateToInterfaceOrientation method. On both the simulator and device, on rotation, the tab bar rotates properly but the currently selected view controller (call it A) does not. If I switch to another view controller B and then back to A (without rotating the device again), A appears correctly rotated. This happens with any of the five view controllers Why doesn't the currently selected view controller rotate and how do I fix it? Thanks.

    Read the article

  • Why are Views loaded from nibs being placed 20 pixels down from the status bar?

    - by rickharrison
    I am trying to set up a layout as such in an iPad application. It will have three major views, which make up the whole screen. The views will be stacked one on top of the other, each taking up the full width. I have one major nib file which accounts for the entire screen space. In that nib file, I am instantiating the three view controllers with outlets. Then I have this code: - (void)viewDidLoad { [super viewDidLoad]; [self.view addSubview:controllerOne.view]; [self.view addSubview:controllerTwo.view]; [self.view addSubview:controllerThree.view]; } This adds the views on top of one another and 20 pixels lower. However, after rotating to landscape and back they are right under the status bar. Do you know what would be causing this?

    Read the article

  • IPhone XCode programming: view called from a navigation view doesn't set its IBOutlet attributes

    - by Antonio Murgia
    I created a view Called ProgrammaView that appears when a row of a table is clicked. This view has a UILabel, a UIImageView and a UITextView. Now. ProgrammaView's Outlets have to be changed by the parameter passed to a method of the view called iniz. in this image there is first the ProgrammaView.h and then the method iniz. The problem is that the label and other stuff doesn't change! I checked 3 million times that everything between the xib file and the controller is linked. The trick to call iniz in the other viewcontrollers works well in other part of the program so i think is not that the problem. Thank you in advance!

    Read the article

  • UISplitViewController Cannot Change the Master View Controller?

    - by Nex
    I am trying to change the master view controller (that appears in the popover in portrait, and on the left side in landscape) in a UISplitViewController. I'd like to switch between the master view controller being one of two different UIViewControllers (depending on an action taken elsewhere in my application). I am using the following: mySplitViewController.viewControllers = [NSArray arrayWithObjects:newMasterController, detailController, nil]; This correctly changes the master viewcontroller as you would expect in landscape mode. However it does not seem to change the viewcontroller used for the popover in portrait mode. I notice that the barbuttonitem to show this master view controller is just calling showMasterInPopover: on the splitviewcontroller, and so would expect it to work in portrait mode as well, but it does not. In fact, I can set the master view controller, see the new viewController correctly in landscape mode, rotate back to portrait, and the viewcontroller used in the popover is still the old one. Is this a bug?

    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

  • UIViewController dismissModalViewControllerAnimated: causes main window to disappear

    - by Jim
    I want to present a modal mail dialogue like so in the iPad app: MFMailComposeViewController* picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:title]; [picker setMessageBody:[NSString stringWithFormat:[self emailBody], title, [link absoluteString]] isHTML:YES]; [self.viewController presentModalViewController:picker animated:YES]; The following delegate is called when the user sends/cancels: - (void) mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self.viewController dismissModalViewControllerAnimated:YES]; } This works great in portrait mode. In landscape mode the right hand pane of the UISplitViewController completely disappears.

    Read the article

  • NSAlert pops up for 3 times

    - by Marco
    Hello community i have a big problem. i implemented an NSAlert in the viewDidLoad() of my app: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:alertMessage delegate:self cancelButtonTitle:ok otherButtonTitles:nil]; But the Alert pops up for 3 times, and then i can klick on it. Could it be that the viewDidLoad() starts for 3 times? This is the viewDidLoad in the rootViewController, that manages the views: - (void)viewDidLoad { Kundenkarte *kartenAnsicht = [[Kundenkarte alloc] initWithNibName:@"Kundenkarte" bundle:nil]; kartenAnsicht.rootViewController = self; kartenAnsicht.viewDidLoad; self.map = kartenAnsicht; [self.view addSubview:kartenAnsicht.view]; [kartenAnsicht release]; // [super viewDidLoad]; } kartenAnsicht is the view where the problem is. I hope someone could help me because my ideas are over!

    Read the article

  • UICollectionViewController nested in a normal UIViewController

    - by patrickS
    I have added a UICollectionView into a normal ViewController (MainViewController), and than created a UICollectionViewController Subclass (CollectionViewController) in the ViewController and connected the UICollectionView outlet with the CollectionViewController object _collectionViewController = [[CollectionViewController alloc] initWithCollectionViewLayout:_collectionView.collectionViewLayout]; _collectionView.dataSource = _collectionViewController; _collectionView.delegate = _collectionViewController; In the CollectionViewController I have setup an simple NSArray object and I show this one. This works as expected. But If I try to access the collectionview from the CollectionViewController via self.collectionview I am not able to access this one. I dont know what I have to do, to also connect the collectionview. I have build a sample ios-app it is available at: https://github.com/patricks/uicollectionview-problem The method - (void)outputSelectedCell in the UICollectionViewController always shows, that there is nothing selected… I hope you understand the problem.

    Read the article

  • Invoke method in another class

    - by Sam
    I have two view controllers (viewControllerA and viewControllerB) with their own views. When the user touches a button in the view of viewControllerA, I am able to load the view of the viewControllerB. However, I don't know how to invoke a method in viewControllerB's class!

    Read the article

  • Inactive area after device rotation

    - by Sébastien
    Hi all, I don't understand what's wrong in my very simple application with device rotation : I built my view with interface builder. (See screen capture here) I specified <key>UIInterfaceOrientation</key><string>UIInterfaceOrientationLandscapeRight</string> in my info.plist file. I had a (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {return YES;} in my root view controller. The area on the left (shown in red on the capture), around 20 pixel width, keeps inactive (nothing append if I hit a button in this area). In fact the full screen is active only in portrait mode, in landscape right mode there is this 20 pixels width inactive area, in landscape left mode this inactive area is on the right, in portrait upside down mode this area is on the bottom. I read lots of posts and documentation about UIView rotation, but I did not find anything to solve this problem (I tried to play with view.frame and view.bounds without any success). Anybody has an idea ? Thanks a lot. Regards. Sébastien.

    Read the article

  • How to prevent a modal UIImagePickerController from rotating?

    - by coneybeare
    I have an app that fully support rotation. I am modally adding a UIImagePickerController for which there is no support for UIInterfaceOrientationLandscape and I cannot get the controller to stay in portrait. In other words, I need to disable rotation for the UIImagePickerController so it stays in portrait, without removing rotation for the rest of my app. this seems basic, but I can't seem to locate it. How can I prevent this rotation? UPDATE As suggested, I tried subclassing with the following code: @interface UAImagePickerController : UIImagePickerController { } @end @implementation UAImagePickerController - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return UIDeviceOrientationIsPortrait(toInterfaceOrientation); } @end The line is not being hit at all with a breakpoint… i think there must be something funky about the UIImagePickerView

    Read the article

  • Hidden UIView Orientation Change / Layout problems

    - by gargantaun
    The Problem: I have two View Controllers loaded into a root View Controller. Both sub view layouts respond to orientation changes. I switch between the two views using [UIView transformationFromView:...]. Both sub views work fine on their own, but if... Views are swapped Orientation Changes Views are swapped again the View that was previously hidden has serious layout problems. The more I repeat these steps the worse the problem gets. Implementation Details I have three viewsControllers. MyAppViewController A_ViewController B_ViewController A & B ViewControllers have a background image each, and a UIWebView and an AQGridView respectively. To give you an example of how i'm setting it all up, here's the loadView method for A_ViewController... - (void)loadView { [super loadView]; // background image // Should fill the screen and resize on orientation changes UIImageView *bg = [[UIImageView alloc] initWithFrame:self.view.bounds]; bg.contentMode = UIViewContentModeCenter; bg.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; bg.image = [UIImage imageNamed:@"fuzzyhalo.png"]; [self.view addSubview:bg]; // frame for webView // Should have a margin of 34 on all sides and resize on orientation changes CGRect webFrame = self.view.bounds; webFrame.origin.x = 34; webFrame.origin.y = 34; webFrame.size.width = webFrame.size.width - 68; webFrame.size.height = webFrame.size.height - 68; projectView = [[UIWebView alloc] initWithFrame:webFrame]; projectView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; [self.view addSubview:projectView]; } For the sake of brevity, the AQGridView in B_ViewController is set up pretty much the same way. Now both these views work fine on their own. However, I use both of them in the AppViewController like this... - (void)loadView { [super loadView]; self.view.autoresizesSubviews = YES; [self setWantsFullScreenLayout:YES]; webView = [[WebProjectViewController alloc] init]; [self.view addSubview:webView.view]; mainMenu = [[GridViewController alloc] init]; [self.view addSubview:mainMenu.view]; activeView = mainMenu; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(switchViews:) name:SWAPVIEWS object:nil]; } and I switch betweem the two views using my own switchView method like this - (void) switchViews:(NSNotification*)aNotification; { NSString *type = [aNotification object]; if ([type isEqualToString:MAINMENU]){ [UIView transitionFromView:activeView.view toView:mainMenu.view duration:0.75 options:UIViewAnimationOptionTransitionFlipFromRight completion:nil]; activeView = mainMenu; } if ([type isEqualToString:WEBVIEW]) { [UIView transitionFromView:activeView.view toView:webView.view duration:0.75 options:UIViewAnimationOptionTransitionFlipFromLeft completion:nil]; activeView = webView; } // These don't seem to do anything //[mainMenu.view setNeedsLayout]; //[webView.view setNeedsLayout]; } I'm fumbling my way through this, and I suspect a lot of what i've done is implemented incorrectly so please feel free to point out anything that should be done differently, I need the input. But my primary concern is to understand what's causing the layout problems. Here's two images which illustrate the nature of the layout issues... UPDATE: I just noticed that when the orientation is landscape, the transition flips vertically, when I would expect it to be horizontal. I don't know wether that's a clue as to what might be going wrong. Switch to the other view... change orientation.... switch back....

    Read the article

  • UIView, UIScrollView and UITextFields problem calling Method

    - by Jeff Groby
    I have a view with several embedded UITextFields, this UIView is subordinated to a UIScrollView in IB. Each text field is supposed to invoke a method called updateText defined in the viewcontroller implementation file when the user is done editing the field. For some reason, the method updateText never gets invoked. Anyone have any ideas how to go about fixing this? The method fired off just fine when the UIScrollView was not present in the project but the keyboard would cover the text fields during input, which was annoying. Now my textfields move up above the keyboard when it appears, but won't fire off the method when done editing. Here is my implementation file: #import "MileMarkerViewController.h" @implementation MileMarkerViewController @synthesize scrollView,milemarkerLogDate,milemarkerDesc,milemarkerOdobeg,milemarkerOdoend,milemarkerBusiness,milemarkerPersonal,milemarker; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Initialization code } return self; } - (BOOL) textFieldShouldReturn: (UITextField*) theTextField { return [theTextField resignFirstResponder]; } - (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(keyboardWasShown:) name: UIKeyboardDidShowNotification object: nil]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(keyboardWasHidden:) name: UIKeyboardDidHideNotification object: nil]; keyboardShown = NO; // 1 [scrollView setContentSize: CGSizeMake( 320, 480)]; // 2 } - (void)keyboardWasShown:(NSNotification*)aNotification { if (keyboardShown) return; NSDictionary* info = [aNotification userInfo]; // Get the size of the keyboard. NSValue* aValue = [info objectForKey:UIKeyboardBoundsUserInfoKey]; CGSize keyboardSize = [aValue CGRectValue].size; // Resize the scroll view (which is the root view of the window) CGRect viewFrame = [scrollView frame]; viewFrame.size.height -= keyboardSize.height; scrollView.frame = viewFrame; // Scroll the active text field into view. CGRect textFieldRect = [activeField frame]; [scrollView scrollRectToVisible:textFieldRect animated:YES]; keyboardShown = YES; } - (void)keyboardWasHidden:(NSNotification*)aNotification { NSDictionary* info = [aNotification userInfo]; // Get the size of the keyboard. NSValue* aValue = [info objectForKey:UIKeyboardBoundsUserInfoKey]; CGSize keyboardSize = [aValue CGRectValue].size; // Reset the height of the scroll view to its original value CGRect viewFrame = [scrollView frame]; viewFrame.size.height += keyboardSize.height; [scrollView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES]; scrollView.frame = viewFrame; keyboardShown = NO; } - (void)textFieldDidBeginEditing:(UITextField *)textField { activeField = textField; } - (void)textFieldDidEndEditing:(UITextField *)textField { activeField = nil; } - (IBAction)updateText:(id) sender { NSLog(@"You just entered: %@",self.milemarkerLogDate.text); self.milemarker.logdate = self.milemarkerLogDate.text; self.milemarker.desc = self.milemarkerDesc.text; self.milemarker.odobeg = self.milemarkerOdobeg.text; self.milemarker.odoend = self.milemarkerOdoend.text; self.milemarker.business = self.milemarkerBusiness.text; self.milemarker.personal = self.milemarkerPersonal.text; NSLog(@"Original textfield is set to: %@",self.milemarker.logdate); [self.milemarker updateText]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)dealloc { [super dealloc]; } @end

    Read the article

  • iPhone: Using a NSMutableArry in the AppDelegate as a Global Variable

    - by aahrens
    What i'm trying to accomplish is to have an NSMutableArray defined in the AppDelegate. I then have two UIViewControllers. One view is responsible for displaying the array from the AppDelegate. The other view is used to add items to the array. So the array starts out to be empty. View1 doesn't display anything because the array is empty. The User goes to View2 and adds an item to the array in AppDelegate. Then when the user goes back to View1 it now displays one item. Here is how I'm trying to accomplish this @interface CalcAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; UITabBarController *tabBarController; NSMutableArray *globalClasses; } @property (nonatomic,retain) NSMutableArray *globalClasses; My other view In the viewDidload I set the array in my View to be the one in the AppDelegate. In an effort to retain values. allCourses = [[NSMutableArray alloc]init]; CalcAppDelegate *appDelegate = (CalcAppDelegate *)[[UIApplication sharedApplication] delegate]; allCourses = appDelegate.globalClasses; Then I would update my allCourses array by adding a new item. Then try to set the array in the AppDelegate to be equal to the modified one. CalcAppDelegate *appDel = (CalcAppDelegate *)[[UIApplication sharedApplication] delegate]; NSLog(@"Size before reset %d",[appDel.globalClasses count]); appDel.globalClasses = allCourses; NSLog(@"Size after reset %d",[appDel.globalClasses count]); What I'm seeing that's returned is 2 in the before, and 2 after. So it doesn't appear to be getting updated properly. Any suggestions?

    Read the article

  • iPhone View Switching basics.

    - by Daniel Granger
    I am just trying to get my head around simple view switching for the iPhone and have created a simple app to try and help me understand it. I have included the code from my root controller used to switch the views. My app has a single toolbar with three buttons on it each linking to one view. Here is my code to do this but I think there most be a more efficient way to achieve this? Is there a way to find out / remove the current displayed view instead of having to do the if statements to see if either has a superclass? I know I could use a tab bar to create a similar effect but I am just using this method to help me practice a few of the techniques. -(IBAction)switchToDataInput:(id)sender{ if (self.dataInputVC.view.superview == nil) { if (dataInputVC == nil) { dataInputVC = [[DataInputViewController alloc] initWithNibName:@"DataInput" bundle:nil]; } if (self.UIElementsVC.view.superview != nil) { [UIElementsVC.view removeFromSuperview]; } else if (self.totalsVC.view.superview != nil) { [totalsVC.view removeFromSuperview]; } [self.view insertSubview:dataInputVC.view atIndex:0]; } } -(IBAction)switchToUIElements:(id)sender{ if (self.UIElementsVC.view.superview == nil) { if (UIElementsVC == nil) { UIElementsVC = [[UIElementsViewController alloc] initWithNibName:@"UIElements" bundle:nil]; } if (self.dataInputVC.view.superview != nil) { [dataInputVC.view removeFromSuperview]; } else if (self.totalsVC.view.superview != nil) { [totalsVC.view removeFromSuperview]; } [self.view insertSubview:UIElementsVC.view atIndex:0]; } } -(IBAction)switchToTotals:(id)sender{ if (self.totalsVC.view.superview == nil) { if (totalsVC == nil) { totalsVC = [[TotalsViewController alloc] initWithNibName:@"Totals" bundle:nil]; } if (self.dataInputVC.view.superview != nil) { [dataInputVC.view removeFromSuperview]; } else if (self.UIElementsVC.view.superview != nil) { [UIElementsVC.view removeFromSuperview]; } [self.view insertSubview:totalsVC.view atIndex:0]; } }

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >