Search Results

Search found 8 results on 1 pages for 'presentmodalviewcontrolle'.

Page 1/1 | 1 

  • PresentModalViewController problem.

    - by james.ingham
    I have a new view controller on the iPhone which I call using the following line of code: [self presentModalViewController:controller animated:NO]; This works great if animation is on, but I am looking to have an instant switch. The problem is when I set animation to NO, the whole view shifts 20px to the right (it is always in landscape mode) as if there is a status bar but in portrait mode!? In this example the yellow space is the new view controller. I've tried this in a new project and the same thing happens. It may be a bug but does anyone have a fix? Thanks

    Read the article

  • presentModalViewController does not want to work when called from a protocol method

    - by johnbdh
    I have a subview that when double tapped a protocol method on the subview's parent view controller is called like this... - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *theTouch = [touches anyObject]; if (theTouch.tapCount == 1) { } else if (theTouch.tapCount == 2) { if ([self.delegate respondsToSelector:@selector(editEvent:)]) { [self.delegate editEvent:dictionary]; } } } Here is the protocol method with the dictionary consuming code removed... - (void)editEvent:(NSDictionary){ EventEditViewController *eventEditViewController = [[EventEditViewController alloc] initWithNibName:@"EventEditViewController" bundle:nil]; eventEditViewController.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:eventEditViewController]; [self presentModalViewController:navigationController animated:YES]; [eventEditViewController release]; } The protocol method is called and runs without any errors but the modal view does not present itself. I temporarily copied the protocol method's code to an IBAction method for one of the parent's view button's to isolate it from the subview. When I tap this button the modal view works fine. Can anyone tell me what I am doing wrong? Why does it work when executed from a button on the parent view, and not from a protocol method called from a subview. Here is what I have tried so far to work around the problem... Restarted xCode and the simulator Ran on the device (iTouch) Presenting eventEditViewController instead of navigationController Using Push instead of presentModal. delaying the call to the protocol with performSelector directly to the protocol, to another method in the subview which calls the protocol method, from the protocol method to another method with the presentModal calls. Using a timer. I have it currently setup so that the protocol method calls a known working method that presents a different view. Before calling presentModalViewController it pops a UIAlertView which works every time, but the modal view refuses to display when called via the protocol method. I'm stumped. Perhaps it has something to do with the fact that I am calling the protocol method from a UIView class instead of a UIViewController class. Maybe I need to create a UIViewController for the subView?? Thanks, John

    Read the article

  • iPhone modal View with alpha transparency?

    - by Moshe
    I am adding a modal view using the following code: [self presentModalViewController:phrasesEditor animated:YES]; How can I make the modal view semi-transparent so that the superview "shines" through? My complete method/function looks like this: -(IBAction)showEditPhrases:(id)sender{ PhrasesViewController *phrasesEditor = [[PhrasesViewController alloc] initWithNibName:@"PhrasesViewController" bundle:nil]; phrasesEditor.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [phrasesEditor.view setAlpha: 0.5]; [phrasesEditor.view setBackgroundColor: [UIColor clearColor]]; [self presentModalViewController:phrasesEditor animated:YES]; [phrasesEditor release]; }

    Read the article

  • iPhone modal View with parent view semi-visible?

    - by Moshe
    I am adding a modal view using the following code: [self presentModalViewController:phrasesEditor animated:YES]; How can I make the modal view semi-transparent so that the superview "shines" through? My complete method/function looks like this: -(IBAction)showEditPhrases:(id)sender{ PhrasesViewController *phrasesEditor = [[PhrasesViewController alloc] initWithNibName:@"PhrasesViewController" bundle:nil]; phrasesEditor.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [phrasesEditor.view setAlpha: 0.5]; [phrasesEditor.view setBackgroundColor: [UIColor clearColor]]; [self presentModalViewController:phrasesEditor animated:YES]; [phrasesEditor release]; }

    Read the article

  • Why does my iOS app crash when trying presentModalViewController?

    - by user555807
    I've been banging my head against this all day, it seems like something simple but I can't figure it out. I've got an iOS app that I created using the "View-based Application" template in XCode. Here is essentially the code I have: AppDelegate.h: #import <UIKit/UIKit.h> @interface AppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; MainViewController *viewController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet MainViewController *viewController; @end AppDelegate.m: #import "AppDelegate.h" #import "MainViewController.h" @implementation AppDelegate @synthesize window, viewController; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self.window addSubview:viewController.view]; [self.window makeKeyAndVisible]; return YES; } - (void)dealloc { [viewController release]; [window release]; [super dealloc]; } @end MainViewController.h: #import <UIKit/UIKit.h> @interface MainViewController : UIViewController { } -(IBAction) button:(id)sender; @end MainViewController.m: #import "MainViewController.h" #import "ModalViewController.h" @implementation MainViewController ... -(IBAction) button:(id)sender { ModalViewController *mvc = [[[ModalViewController alloc] initWithNibName:NSStringFromClass([ModalViewController class]) bundle:nil] autorelease]; [self presentModalViewController:mvc animated:YES]; } @end There's nothing of interest in the ModalViewController. So the modal view should display when the button is pressed. When I press the button, it hangs for a second then crashes back to the home screen with no error message. I am stumped, please show me what I'm doing wrong!

    Read the article

  • presentModalViewController NOT animating when showing a TTMessageController

    - by wgpubs
    I have a subclass of TTMessageController that shows ... BUT it is not animated even though it should be. The code that displays the modal view looks like this (where PostToWebMessageController is the subclass of TTMessageController: if (self.toWebMsgController == nil) { self.toWebMsgController = [[PostToWebMessageController alloc] init]; } UINavigationController *navController = [[UINavigationController alloc] init]; [navController pushViewController:self.toWebMsgController animated:NO]; [self presentModalViewController:navController animated:YES]; What happens though is this: The screen goes black ... the keyboard scrolls up into view ... and THEN the TTMessageController view shows up (not animated). When I dismiss the view via a Cancel button the screen goes black and then just disappears (no animation again). Any ideas why this is happening? I've this with a number of other TT* controllers and I can't get one to animate right with showing modally. Thanks

    Read the article

  • MFMessageComposeViewControllerDelegate error - black screen

    - by user1053839
    I'm using the following code to show in-app sms. My app don't have a status bar. (I'm using 320x480 pixels screen in portrait view). the problem is that when I load the controller, the screen becomes black as you can see from the image... http://desmond.imageshack.us/Himg211/scaled.php?server=211&filename=schermata092456187alle1.png&res=landing this is the code: MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init]; picker.messageComposeDelegate = self; picker.recipients = [NSArray arrayWithObject:@"123456789"]; // your recipient number or self for testing picker.body = @"test"; [self presentModalViewController:picker animated:YES];

    Read the article

  • Nested modal view controller gives strange message under iOS6?

    - by user1840362
    I am presenting a modal view controller from another modal view controller, and this worked fine under all iOS versions prior to iOS6. But under iOS6 I am getting the following warning message in the emulator: Warning: Attempt to present <UINavigationController: 0x14e93680> on <UINavigationController: 0x9fc6b70> while a presentation is in progress! The modal view controller is not shown if this warning appears. Basically I am using code like this to show the modal view controller: WebAuthViewController *authController = [[WebAuthViewController alloc] initWithNibName:nil bundle:nil]; authController.challenge = challenge; authController.delegate = self; UINavigationController *aNavController = [[UINavigationController alloc] initWithRootViewController:authController]; [self presentModalViewController:aNavController animated:YES]; [aNavController release]; [authController release]; The view that is already shown is a UIWebView also shown in a modal view, like this: WebViewController *addController = [[WebViewController alloc] initWithNibName:nil bundle:nil]; addController.urlToLoad = [NSURL URLWithString:urlString]; addController.delegate = self; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addController]; navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:navigationController animated:YES]; [navigationController release]; [addController release]; The apple docs still suggest that one is supposed to be able to stack navigation controllers like this, so I am at a loss to explain why this happens. Any hints?

    Read the article

1