Search Results

Search found 9 results on 1 pages for 'uistoryboard'.

Page 1/1 | 1 

  • Re-usable views or xibs for use with UIStoryboard

    - by Leonardo
    I find it very convenient to use storyboards, especially to have (and show) an overview of the application. However, I also find it very annoying to replicate the same code and views without the possibility to keep at least a reusable library of the most common xibs. This is especially true with UITableView and its cell. Did some of you have had any idea or best practice to share for dealing with this issue?

    Read the article

  • UIStoryboard load from app delegate

    - by Alessandro
    I am trying to load a UIStoryboard from the app delegate .m in this way: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]]; UIViewController *vc =[storybord instantiateInitialViewController]; [self.window addSubview:vc.view]; return YES; } What is the problem with this code?? any idea?

    Read the article

  • Segue Popover won't behave properly

    - by CStreel
    I'm trying to use Segue to present then dismiss a Popover view a UIBarButtonItem is clicked. I've created a generic Segue that is not anchored to anything but the view and given it a name I've Anchored the UIBarButtonItem in the Interface Builder to: - (IBAction)clickedSettings:(id)sender { if(self.popSegue != nil) { [self.popSegue.popoverController dismissPopoverAnimated:YES]; } else { //Current says only a button may [self performSegueWithIdentifier:@"Settings" sender:sender]; } } But when ever i click the button to display the Segue it gives me an error: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIStoryboardPopoverSegue must be presented from a bar button item or a view.' It doesn't even hit my -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender I've read the following questions on stack: iOS:How to dismiss Popover UIBarButtonItem + popover segue creates multiple popovers But i still get the same error. For the life of me i can't figure out what is going wrong

    Read the article

  • My map callouts don't display the image when clicked

    - by Neelam Khan
    I am developing an iPhone application for a university project and I'm new to iPhone development. I have looked through Apple's MapCallouts code but it doesn't seem feasible to implement it. So far my code displays a map, drops annotations, displays the title and it displays the right call out button. But this is where I encounter problems. When I press on the callout button, it displays a blank view controller but it should display a different image for every callout that's tapped and this isn't happening so far. I have added my code below: - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { //NSUInteger tag = ((UIButton *)control).tag; if (self.detailController==nil) { DetailViewController* detailViewController = [[DetailViewController alloc] init]; [self.navigationController pushViewController:detailViewController animated:YES]; } // self.detailController.tag =1; //to identify image required // self.detailController.tag = tag; [self.navigationController pushViewController:detailController animated:YES]; }

    Read the article

  • Calling popToRootViewControllerAnimated causing crash. How should I be doing this?

    - by Lewis42
    The app is for taking body measurements. The user can say I want to measure: legs, arms and neck, in the settings tab and in the main tab there is a view which loops round to take each measurement. This is achieved like so: i have tab controller the first tab has a navigation controller the first view controller on the storyboard and has one segue to itself the board loops round until it has all the measurements then it segues to a different controller the problem is: if the user changes which measurements they are taking in the settings tab, the first tab needs to completely reload, as if the app was just starting up, clearing down the whole nav stack etc. at the moment the tab controller calls popToRootViewControllerAnimated on the navigation controller in the measurements tab, but this is causing a crash. Each screen has a slider control and a call to titleForRow:forComponent: is being called on a deleted view causing it to crash. What am I doing wrong?! Here's the tab bar controller code // TabBarController.m // #import "TabBarController.h" #import "TodaysMeasurementObject.h" #import "AppDelegateProtocol.h" #import "AddMeasurementViewController.h" #import "ReadPerson.h" #import "AppDelegate.h" @interface TabBarController () <UITabBarControllerDelegate> @end @implementation TabBarController bool resetWizardView = false; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.delegate = self; [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(measurementsSettingsUpdated:) name:@"MeasurementsSettingsUpdated" object:nil]; } - (void) measurementsSettingsUpdated:(NSNotification *) notification { // UINavigationController *navigationController = [self.viewControllers objectAtIndex:0]; // AddMeasurementViewController *addMeasurement = [[AddMeasurementViewController alloc] init]; // [navigationController setViewControllers: [[NSArray alloc] initWithObjects:addMeasurement, nil]]; resetWizardView = YES; } - (void) viewDidAppear:(BOOL)animated { if (![ReadPerson userHasRecords]) { [self setSelectedIndex:3]; } } - (void)orientationChanged:(NSNotification *)notification { // We must add a delay here, otherwise we'll swap in the new view // too quickly and we'll get an animation glitch [self performSelector:@selector(showGraphs) withObject:nil afterDelay:0]; } - (void)showGraphs { UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation; if (deviceOrientation == UIDeviceOrientationLandscapeLeft && !isShowingLandscapeView) { [self performSegueWithIdentifier: @"toGraph" sender: self]; isShowingLandscapeView = YES; } else if (deviceOrientation != UIDeviceOrientationLandscapeLeft && isShowingLandscapeView) { [self dismissModalViewControllerAnimated:YES]; isShowingLandscapeView = NO; } } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if(interfaceOrientation == UIInterfaceOrientationLandscapeRight) { [self performSegueWithIdentifier: @"toGraph" sender: self]; } return false; } - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { int tbi = tabBarController.selectedIndex; if (tbi == 0) { [[viewController view] setNeedsDisplay]; if (resetWizardView) { [(UINavigationController*)[self.viewControllers objectAtIndex:0] popToRootViewControllerAnimated: NO]; // ******* POP CALLED HERE ****** resetWizardView = false; } } } - (TodaysMeasurementObject*) theAppDataObject { id<AppDelegateProtocol> theDelegate = (id<AppDelegateProtocol>) [UIApplication sharedApplication].delegate; TodaysMeasurementObject* theDataObject; theDataObject = (TodaysMeasurementObject*) theDelegate.theAppDataObject; return theDataObject; } - (BOOL)shouldAutorotate { return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } @end UPDATED - (void) measurementsSettingsUpdated:(NSNotification *) notification { NSMutableArray *viewControllers = [[NSMutableArray alloc] initWithArray: self.viewControllers]; UINavigationController *navigationController = [viewControllers objectAtIndex:0]; AddMeasurementViewController *addMeasurement = [[AddMeasurementViewController alloc] init]; [navigationController setViewControllers: [[NSArray alloc] initWithObjects:addMeasurement, nil]]; [viewControllers setObject:navigationController atIndexedSubscript:0]; self.viewControllers = viewControllers; } and removed the code from - tabBarController:didSelectViewController: but still the same error. I think the problem is that it's trying to get a value for the slide control after the view has been deleted. But some part of the view must still be alive...? Anyway to kill that off? Or leave it all alive??

    Read the article

  • Storyboard changing controller (modal) not working

    - by BrandNew
    I have problem with navigation between ViewControllers: here is my storyboard: http://postimg.org/image/dar9pkuvl/ The navigation between controllers in green rectangle works fine, I add to controller number 1 controller number 2 (by addtosubview) and then controllers number 3,4,5 to UIScrollView in controller number 2 ( controller number 2 contain scrollview). Everything work fine but if I click Send buttn on controller 4 nothing happens (It is strange because I was added connection between button and controller in the same way like between controllers 7 and 8). I know it is little bit confusing described, but I hope that someone tell me where is problem. Thanks

    Read the article

  • What is the best practice when using UIStoryboards?

    - by Scott Sherwood
    Having used storyboards for a while now I have found them extremely useful however, they do have some limitations or at least unnatural ways of doing things. While it seems like a single storyboard should be used for your app, when you get to even a moderately sized application this presents several problems. Working within teams is made more difficult as conflicts in Storyboards can be problematic to resolve (any tips with this would also be welcome) The storyboard itself can become quite cluttered and unmanageable. So my question is what are the best practices of use? I have considered using a hybrid approach having logical tasks being split into separate storyboards, however this results in the UX flow being split between the code and the storyboard. To me this feels like the best way to create reusable actions such as login actions etc. Also should I still consider a place for Xibs? This article has quite a good overview of many of the issues and it proposes that for scenes that only have one screen, xibs should be used in this case. Again this feels unusual to me with Apples support for instantiating unconnected scenes from a storyboard it would suggest that xibs won't have a place in the future but I could be wrong.

    Read the article

  • Unable to call storyboard from xib

    - by Shruti Kapoor
    I am new to iOS development. I am trying to connect to a storyboard from xib file. My xib View Controller has a "Login" which if successful should connect to storyboard. I have googled and searched on stackoverflow for a solution and I am using this code that is given everywhere: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; YourViewController * yourView = (YourViewController *)[storyboard instantiateViewControllerWithIdentifier:@"identifier ID"]; I have created an identifier for my storyboard as well. However, I am not being redirected to the storyboard no matter what I try. When the login finishes, I go back to my main View Controller (xib). I should be instead redirected to the storyboard. Here is what my code looks like in a file called ProfileTabView.m: -(void) loginViewDidFinish:(NSNotification*)notification { [[NSNotificationCenter defaultCenter] removeObserver:self]; UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil]; ProfileTabView * yourView = (ProfileTabView *)[storyboard instantiateViewControllerWithIdentifier:@"myID"]; } I have implemeted this code in the function that gets called once the login is successful. However, the storyboard "Storyboard" never gets called. Am i doing this right? Am I supposed to be writing this code anywhere else? Thanks a lot for any help :)

    Read the article

  • Load view when button is clicked in Xcodes Storyboard

    - by dooonot
    I just started to use Storyboard in Xcode. I have a starting view that has some buttons inside. Is there a way to load a special view when a button is clicked? I only found this workaround: -(IBAction)loadRegistration:(id)sender { // load registration controller UIStoryboard *storyboard = self.storyboard; RegisterController *svc = [storyboard instantiateViewControllerWithIdentifier:@"RegisterController"]; [self presentViewController:svc animated:YES completion:nil]; }

    Read the article

1