Search Results

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

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

  • iPhone crashing when presenting modal view controller

    - by Michael Waterfall
    Hi there, I'm trying to display a modal view straight after another view has been presented modally (the second is a loading view that appears). - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // Show load LoadViewController *loader = [[LoadViewController alloc] init]; [self presentModalViewController: loader animated:NO]; [loader release]; } But when I do this I get a "Program received signal: "EXC_BAD_ACCESS"." error. The stack trace is: 0 0x30b43234 in -[UIWindowController transitionViewDidComplete:fromView:toView:] 1 0x3095828e in -[UITransitionView notifyDidCompleteTransition:] 2 0x3091af0d in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] 3 0x3091ad7c in -[UIViewAnimationState animationDidStop:finished:] 4 0x0051e331 in run_animation_callbacks 5 0x0051e109 in CA::timer_callback 6 0x302454a0 in CFRunLoopRunSpecific 7 0x30244628 in CFRunLoopRunInMode 8 0x32044c31 in GSEventRunModal 9 0x32044cf6 in GSEventRun 10 0x309021ee in UIApplicationMain 11 0x00002154 in main at main.m:14 Any ideas? I'm totally stumped! The loading view is empty so there's definitely nothing going on in there that's causing the error. Is it something to do with launching 2 views modally in the same event loop or something? Thanks, Mike Edit: Very strange... I have modified it slightly so that the loading view is shown after a tiny delay, and this works fine! So it appears to be something within the same event loop! - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // Show load [self performSelector:@selector(doit) withObject:nil afterDelay:0.1]; } - (void)doit { [self presentModalViewController:loader animated:YES]; }

    Read the article

  • UIView rotation, modal view lanscape and portrait, parent fails to render

    - by Ben
    Hi everyone, I've hit a bit of a roadblock with something that I hope that someone in here can help me out with. I'll describe the 'state of play' first, and then what the issue is, so here goes; I have a series of view controllers that are chained together with a Navigation Controller (this works just fine), All of these view controllers support portrait mode only (by design), In one of the view controllers (the 'end' one actually) the user can click a table cell to pop up a modal view controller (using presentModalViewController(...) of course) This modal view controller supports portrait and landscape modes (and this works), When the user clicks the 'Done' button on this modal view controller we pop and pass control back to the parent view controller, however; If the user is in portrait mode when they click 'Done' then the parent displays itself just fine, If the user is in landscape mode when they click 'Done' then the parent displays a totally white, blank screen (that covers the whole screen). It is as if the controller does not know how to render in landscape and just doesn't bother. I'd like to be able to have this parent view render in portrait no matter what the orientation of the phone is when the user clicks the 'Done' button. Various forum posts suggest using the UIDevice method 'setOrientation' (but this is undocumented and will get our app rejected apparently). Another suggestion was to set the 'statusBarOrientation' to portrait in the 'viewWillAppear' method but that had no effect. So I am a bit stuck! Has any encountered anything like this before? If need be I can provide code, if that will help anyone diagnose the problem for me. Thanks in advance! Cheers, Ben

    Read the article

  • Popover with embedded navigation controller doesn't respect size on back nav

    - by quixoto
    I have a UIPopoverController hosting a UINavigationController, which contains a small hierarchy of view controllers. I followed the docs and for each view controller, I set the view's popover-context size like so: [self setContentSizeForViewInPopover:CGSizeMake(320, 500)]; (size different for each controller) This works as expected as I navigate forward in the hierarchy-- the popover automatically animates size changes to correspond to the pushed controller. However, when I navigate "Back" through the view stack via the navigation bar's Back button, the popover doesn't change size-- it remains as large as the deepest view reached. This seems broken to me; I'd expect the popover to respect the sizes that are set up as it pops through the view stack. Am I missing something? Thanks.

    Read the article

  • How do I replace a modal view controller?

    - by Theory
    I'm using a modal view controller to allow a user to select an address book entry and email address. The ABPeoplePickerNavigationController object is displayed via presentModalViewController:animated: [self presentModalViewController:picker animated:YES]; What I want to do is keep the modal dialog up, but when the user selects the email address, it should cross-fade to a different controller that displays a message composition window. I've tried various approaches in peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier: to dismiss the picker and set my custom composition controller as the modal view. I can do it any number of ways, but never does it fade smoothly from the picker to the composition controller -- unless I make the composition controller a modal dialog of the picker, in which case the picker re-appears when I dismiss the composition controller. I don't want that, either. There must be some way to smoothly replace one controller and its view with another controller and its view, all within the context of a modal dialog, and preferably with a cross fade. Suggestions greatly appreciated.

    Read the article

  • how to generate an event

    - by user262325
    Hello everyone I created a subclass from UIView #import <UIKit/UIKit.h> @interface MeeSelectDropDownView : UIView { UILabel *mainText; UIImage *bgImg; UIImageView *bgView; UIImageView *originView; NSMutableArray *labelArray; int selectedItem; BOOL inSelectTag; float _defaultHeight; } @property (nonatomic , retain) UIImage *bgImg; @property (nonatomic , retain) UIImageView *bgView; @property (nonatomic , retain) NSMutableArray *labelArray; @property (nonatomic , retain) UIImageView *originView; @property (nonatomic , retain) UILabel *mainText; @property (nonatomic , readonly) int selectedItem; - (void) setViewHeight:(float)aheight; -(void) showDropList; -(void) hiddenDropList; -(void) setStringByArray:(NSArray*)array; -(void)hiddenLabels { for(UILabel *aLabel in labelArray){ [aLabel removeFromSuperview]; } } Is it possible to generate an Event from function 'hiddenLabels' to inform and do somethings Thanks interdev

    Read the article

  • Which pattern should be used for editing properties with modal view controller on iPhone?

    - by Matthew Daugherty
    I am looking for a good pattern for performing basic property editing via a modal view on the iPhone. Assume I am putting together an application that works like the Contacts application. The "detail" view controller displays all of the contact's properties in a UITableView. When the UITableView goes into edit mode a disclosure icon is displayed in the cells. Clicking a cell causes a modal "editor" view controller to display a view that allows the user to modify the selected property. This view will often contain only a single text box or picker. The user clicks Cancel/Save and the "editor" view is dismissed and the "detail" view is updated. In this scenario, which view is responsible for updating the model? The "editor" view could update the property directly using Key-Value Coding. This appears in the CoreDataBooks example. This makes sense to me on some level because it treats the property as the model for the editor view controller. However, this is not the pattern suggested by the View Controller Programming Guide. It suggests that the "editor" view controller should define a protocol that the "detail" controller adopts. When the user indicates they are done with the edit, the "detail" view controller is called back with the entered value and it dismisses the "editor" view. Using this approach the "detail" controller updates the model. This approach seems problematic if you are using the same "editor" view for multiple properties since there is only a single call-back method. Would love to get some feedback on what approach works best.

    Read the article

  • How to create a view controller that supports both landscape and portrait, but does not rotate between them (keeps its initial orientation)

    - by Joshua J. McKinnon
    I want to create a view controller that supports both landscape and portrait orientations, but that can not rotate between them - that is, the view should retain its original orientation. I have tried creating an ivar initialOrientation and setting it in -viewDidAppear with initialOrientation = self.interfaceOrientation; then - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == initialOrientation); } But that causes confusing problems (presumably because -shouldAutorotateToInterfaceOrientation is called before -viewDidAppear). How can I lock the orientation to its original orientation?

    Read the article

  • Fully-loaded UIViewController losing all it's data after adding to scroll view

    - by clozach
    Summary I'm repurposing Apple's Page Control project. In loadScrollViewWithPage:, the view controllers that I'm adding to the scroll view appear on screen without their initialized values, as if displayed directly from the nib. Specifics Here's the code that appears to be working when I step through it: CBFullScreenViewController *controller = [viewControllers objectAtIndex:page]; if ((NSNull *)controller == [NSNull null]) { controller = [[CBFullScreenViewController alloc] init]; // Populate the view from the corresponding CBImage object CBImage *imageObject = [imageArray objectAtIndex:page]; BOOL bookmarked = [imageObject.bookmarked boolValue]; controller.bookmarkButton.highlighted = bookmarked; NSString *subtitle = imageObject.subtitle; controller.closedSubtitleLabel.text = subtitle; // <-- snip...more initialization --> // controller.delegate = self; [viewControllers replaceObjectAtIndex:page withObject:controller]; [controller release]; } // add the controller's view to the scroll view if (nil == controller.view.superview) { CGRect frame = scrollView.frame; frame.origin.x = frame.size.width * page; frame.origin.y = 0; controller.view.frame = frame; [scrollView addSubview:controller.view];//<< controller and subviews } // all have non-null, seemingly // valid values at this point Here's the init method in CBFullScreenViewController: - (id)init { if ((self = [super initWithNibName:@"CBFullScreenViewController" bundle:nil])) { self.cover = [[UIImageView alloc] init]; self.homeButton = [[UIButton alloc] init]; self.tabView = [[UIButton alloc] init]; self.closedSubtitleLabel = [[UILabel alloc] init]; self.openSubtitleLabel = [[UILabel alloc] init]; // <-- snip...more initialization --> // } return self; } While troubleshooting this for the last 2 hours has helped me track down some unrelated memory leaks, I can't for the life of me figure out what's happening to the values I'm putting into my view! Oh, it's probably worth mentioning that I've got @synthesize for each of my outlets, and they're all hooked up in IB. Screenshot here.

    Read the article

  • How can I push a new view controller onto a different nav controllers stack and switch to it?

    - by Derek
    I have a Tab Bar Controller created in Interface Builder Within the Tab Bar are 4 Navigation Controllers. Each controller functions separately and perfectly (yay!) What I need to be able to do is a push a view controller onto a different nav controllers stack and switch the focus onto the appropriate tab bar item (so that the user moves sideways (to a different tab) and up (to a new view) at the same time). This is my first time working with a tab bar controller, and while it's been simple to this point, figuring this out is giving me fits. Any tips you can toss my way would be much appreciated.

    Read the article

  • shouldAutorotateToInterfaceOrientation won't work!

    - by Dror Sabbag
    Hey. I've been writing my Universal application in portrait mode, and now after about 15 nib files, many many viewCotnrollers, i'd like to implement the shouldAutorotateToInterfaceOrientation and desing some screens in Landscape mode. adding : - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } to ALL of my viewControllers, does not do the work. During Debug, i see that this method is called, but it just won't work! not in the simulator, not in the device, not in Iphone, not in Ipad! i've searched some answers in the forum, and saw some advises to use: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ); } Didn't worked either, adding: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; and [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; to my viewDidLoad and viewDidUnload respectively didn't worked either. I'm lost.. Any help will do! just one more info... all my Views are of type UIControl, as i needed the TuchUpInside to work. Appriciate your help.

    Read the article

  • addSubview like modal

    - by brettr
    How can I get a UIView to transition via addSubview like the presentModalViewController does? The available animations don't seem to do this. I would use the modal but I have a navigation bar at the top and don't want to disable it. Also, the modal overlays on the navigation bar. If there is a way to have it so the modal doesn't disable the nav bar, I can go with that approach. But since it is a modal, I don't think that is possible.

    Read the article

  • How to make music plays from begging of the app until a viewcontroller has been presented?

    - by Carlos Vargas
    Hey guys I have a problem with an app Im making. The thing is I want to add it some background music, but I just want to add it in the main view. My app has 3 view controllers: Main View Controller, Second View Controller and Third View Controller. What I want is to start the music in the Main View Controller and stop it when the Third View Controller is presented. I think I have to start the music in my app delegate and from there stop it, am I right? I hope someone's got the answer. Best Regards Carlos Vargas

    Read the article

  • Setting an NSMutableArray in AppDelegate to be an NSMutableArray in

    - 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

  • View Controller's viewDidLoad method finishing before applicationDidFinishLaunching

    - by mwt
    I'm creating a fairly complex iPhone app using Core Data. Up until now, things have been working fine. As the app has been getting more complex, however, a new problem has come up: the first view controller is finishing its viewDidLoad method before the AppDelegate gets even halfway through its applicationDidFinishLaunching method. The view controller is not the root, which is a tab bar controller. The VC in question is the one for the default selected tab on the tab bar. It's getting instantiated by IB. Nothing like this has occurred before in my experience, and it's throwing off the important initialization I'm doing in the AppDelegate (getting objects from Core Data and preparing them for use) . Furthermore, it's intermittent -- sometimes the delegate does finish first. Has anyone else noticed a difficulty like this? Any sample code that deals with such an issue? I suppose that the answer is to make the VC load the data that the AppDelegate is getting ready only when the AppDelegate sends a message that it's ready. I'm a bit concerned that this is adding something that will just end up biting me in the butt later on.

    Read the article

  • iPad modal form sheet takes up the whole screen anyways

    - by quixoto
    I'm trying to create a form sheet modal on iPad, which should be a 540x620 modal view. I've created a view controller with a NIB file whose view is a 540x620 sized UIView (with stuff on it). I set the modal presentation style to UIModalPresentationFormSheet, and call presentModalViewController:animated: on the current view controller. My view slides in from the bottom, but instead of being a form sheet, it takes up the whole screen (my view elements are all anchored in the top left of the screen). Even stranger, when I dismiss it, all the UI that was "underneath" it, is all re-layed out to be in the center, in approximately a form sheet sized area in the center of the screen. Bizarro! Anyone have any suggestions as to what could cause this behavior? Thanks.

    Read the article

  • Adding UIViews with dynamic heights iphone

    - by Andy Jacobs
    in my viewcontroller's view i need to add a couple of custom UIView's, i do that in the loadView method so in my custom uiview's drawRect method i add a couple of UILabel's. in my viewcontroller's view i need to add all those custom UIView's underneath each other but i don't know what their height is sometimes 20px, 40px, 60px, depending on the outcome of the drawRect so when i init my custom UIView i give it a frame height of lets say 50.. but when the drawRect is done and it's only 20, 50 is too much so i need to adjust the frame height but how can i determine what's the visible height of the custom UIView and where can i catch it in my viewcontroller when the custom uiview has finished his drawRect method is there some kind of autoresize and where do i catch it in my viewcontroller, so i can position the custom uiview right under neath each other.

    Read the article

  • View controllers inside tab bar controller not auto-resizing on rotation

    - by Padawan
    (Correction: the view controllers are not auto-resizing instead of not auto-rotating.) 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 and the current view controller rotate but the currently selected view controller (call it A) does not resize properly. It keeps its portrait width and height (but it is rotated). If I switch to another view controller B and then back to A (without rotating the device again), A appears correctly resized. This happens with any of the five view controllers Why doesn't the currently selected view controller resize immediately on rotation and how do I fix it? Thanks.

    Read the article

  • Can I push a modal view controller from within another modal view controller?

    - by Andy
    I've got a rootViewController that, at one point, displays a peoplePickerNavigationController. I'm trying to push a second view controller when my user selects a specific contact property, like so: -(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)picker shouldContinueAfterSelectingPerson:(ABPersonRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier { RuleBuilder *ruleBuilder = [[RuleBuilder alloc] initWithNibName:@"RuleBuilder" bundle:nil]; [self pushModalViewController:ruleBuilder animated:YES]; [ruleBuilder release]; return NO; } This compiles just fine, but when I run the code in the simulator and run through the peoplePicker, nothing happens when I select a contact property. On a whim, I added a [self dismissModalViewControllerAnimated:YES]; just before [ruleBuilder release]; and that dismisses the peoplePicker, but otherwise has no effect on my missing ruleBuilder. Any ideas?

    Read the article

  • Reuse nib's across multiple UIViewControllers

    - by colm
    I've created some custom UITableViewCells in a nib file and would like to use that across multiple UIViewControllers. Can anyone tell me the best practice way to do that? My limited knowledge around loading nibs seems to suggest that you have to specify a single owner class in Interface Builder. Thanks.

    Read the article

  • Difficulty with apps with a forced landscape orientation

    - by mahboudz
    I have two apps, both of which force the user to use the iPhone in landscape mode, in order to have a wider screen, instead of a taller one. One of the things I have found is that my first view will look fine, but all other views come up with their subviews (UIButtons, UIPicker, UIViews) squeezed to one side or clipped (depending on whether the elements were set to move, resize or stay in the same position as the view size changed). All my views are designed in IB in the landscape orientation. My underlying UIWindow, and everything I can think of has been laid out in landscape orientation. Even my plist file has the UIInterfaceOrientationLandscapeRight flag set. Now, if I load all my views at the same time as my rootview controller, then I have no problems. But if I have views loaded later, they get clipped or squeezed. The only way to get around the problem was to add the following line in my code that flips in a new view: [coming.view setFrame:CGRectMake(0, 0, 480, 300)]; Anyone know why I need to do this? Is it just that the iPhone assumes that loaded views are 300x480 unless a transform gets applied to them? Thanks. ps. This is what the view looks like if I don't call setFrame, as described above: All viewcontrollers that get loaded after the first one will have their screen similarly squeezed down. For some reason the first viewcontroller doesn't have this issue.

    Read the article

  • Custom view in iPhone SDK gets placed incorrectly in realation to statusbar

    - by markqvist
    (ragh, i'm apparently not allowed to post images, so i have included links to the images in this post instead of embedding them) Im writing an iPhone application based on the navigation controller template, but I am not loading the actual navigation controller as the first view in the window. I create a new view controller from a xib, and then add that as a subview, and then only push the navigation view as a modal when i need it. Here's my application: didFinishLaunching ... method in the application deleate RootViewController *rootViewController = (RootViewController *)[navigationController topViewController]; rootViewController.managedObjectContext = self.managedObjectContext; mainViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:[NSBundle mainBundle]]; mainViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [window addSubview:[mainViewController view]]; [[mainViewController view] setNeedsLayout]; [window makeKeyAndVisible]; return YES; It works but the view is not properly aligned with the statusbar: http://img.exdev.dk/1.png When i click "my ambiances" and push the navigation controller view, and then dismiss it again, the layout is fine: same link as above, just replace the 1 with a 2. Sorry for the hassle, apparently I can also only post one link.... Here's the code I use for presenting/dismissing the navigationcontroller: -(void)pushMyAmbiences { [mainViewController presentModalViewController:navigationController animated:TRUE]; } -(void)returnToMainView { [mainViewController dismissModalViewControllerAnimated:TRUE]; } Is there anything I'm missing here? Layout-wise? Something that needs to be set in the xib? In a vain attempt I tried calling setNeedsLayout on the view, no luck. Any help is greatly appreciated!

    Read the article

  • What library is used for the main menu in the facebook iOS app?

    - by Seth
    I'm making an app that has more options than will easily fit into a UITabBarController. I wanted to use something like what the facebook app has for its main menu. My guess is that it isn't proprietary to facebook, because the SCVNGR app uses something similar. This library lets you re-order the icons the way you can re-order the apps from the main menu (i.e. press and hold - icons jiggle - you can drag them around). Does anyone know what library provides this UIView? I'd like to use it if possible. 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 | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >