Search Results

Search found 45 results on 2 pages for 'modalviewcontroller'.

Page 1/2 | 1 2  | Next Page >

  • 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

  • iPhone - ModalViewController not raising to top of the screen

    - by Oliver
    Hello, I have a UIImagePickerController that is shown [self presentModalViewController:self.picker animated:NO]; Then later on the code, I allow the user to display a preference panel : PreferencesController *nextWindow = [[[PreferencesController alloc] initWithNibName:@"Preferences" bundle:nil] autorelease]; UINavigationController* navController = [[[UINavigationController alloc] initWithRootViewController:nextWindow] autorelease]; [self presentModalViewController:navController animated:YES]; At this point, the new controller raises on the screen, but don't go to the top. Some space is left "transparent" at the top (I can see the camera view behind), and the bottom of the view is hidden out of the screen. The space I am talking about is about a status bar height. The status bar is not present on the screen. The navigation controller is hidden : self.navigationController.navigationBarHidden = YES; There is a toolbar at the top of the view. Nothing special into the view. The height of the view is defined at 480. All simulated element are set off in IB. The autoresize properties are all set on. I had a previous xib (I rebuilt it from scratch) that worked very well. I don't see what I missed on this one (I have only changed the xib, that replaces the previous one). I've cleaned the cache to be sure there was nothing left. No change... I've deleted everything in the new view to prevent some conflicts. No change... What did I miss ? How could I remove this empty space ?

    Read the article

  • Changing a view after modalViewController is dismissed (Cocoa Touch)

    - by Calvin L
    I have a viewController that presents a modalViewController when a UINavigationBarItem is touched. After the user is done with the modal view, the modalViewController is dismissed. At this point I want to change/remove the NavigationBarItem -- how would I accomplish this? I was thinking of using viewWillAppear: but I only want the change to happen when the modalViewController is dismissed.

    Read the article

  • How do I use a modalViewController Identically in Two Controllers?

    - by Theory
    I'm using the Three20 TTMessageController in my app. I've figured out how to use it, adding on a bunch of other stuff (including TTMessageControllerDelegate methods and ABPeoplePickerNavigationControllerDelegate methods). It works great for me, after a bit of a struggle to figure it out. The trouble I'm having now is a design issue: I want to use it identically in two different places, including with the same delegate methods. My current approach is that I've put all the code into a single class inheriting from NSObject, called ComposerProxy, and I'm just having the two controllers that use it use the proxy, like so: ComposerProxy *proxy = [[ComposerProxy alloc] initWithController:this]; [proxy go]; The go method constructs the TTMessageController, configures it, adds it to a UINavigationController, and presents it: [self.controller presentModalViewController: navController animated: YES]; This works great, as I have all my code nicely encapsulated in ComposerProxy and I need only the above two lines anywhere I want to use it. The downside, though, is that I can't dealloc the proxy variable without getting crashes. I can't autorelease it, either: same problem. So I'm wondering if my proxy approach is a poor one. How does one normally encapsulate a bunch of behaviors like this without requiring a lot of duplicate code in the classes that use it? Do I need to add a delegate class to my ComposerProxy and make the controller responsible for dismissing the modal view controller in a hypothetical composerDidFinish method or some such? Many TIA!

    Read the article

  • modalViewController present when app opens

    - by Sam Jarman
    Hey im trying to display a modal view controller as soon as my tab bar controller app opens. There is something wrong with the code below, and im 99% sure its the code for this. what do i put for the thing im calling it on? [self presentModalViewController:promt animated:YES]; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after app launch. //Displays the password prompt modally PasswordPromViewController *promt = [[PasswordPromViewController alloc] initWithNibName:@"PasswordPromViewController" bundle:nil]; promt.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:promt animated:YES]; [promt release]; return YES; } any ideas would be helful! Cheers

    Read the article

  • problem with showing modalviewcontroller in landscape mode in iphone?

    - by abhiTouchmagic
    hey hello... my application consist of a landscape view where i want to put a modalview but the problem is with modalview. it doesn't get load on presenting it.. code is: --------------------code here---------------------- UIViewController *modalViewController = [[UIViewController alloc] init]; modalViewController.view = modelView1; [self presentModalViewController:modalViewController animated:NO]; [self performSelector:@selector(hideSplash) withObject:nil afterDelay:5.0]; plz kindly help me with this....

    Read the article

  • iPad/iPhone Dev: displayViewController Is Rendering Portrait in Landscape Orientation

    - by Holly
    -(void)displayFirstScreen { UIViewController *displayViewController=[[UIViewController alloc] init]; displayViewController.view = displaySplash; [self presentModalViewController:displayViewController animated:NO]; [self performSelector:@selector(removeScreen) withObject:nil afterDelay:2.0]; [displayViewController release]; } -(void)removeScreen { [[self modalViewController] dismissModalViewControllerAnimated:YES]; } The above code works but my orientation is landscape and the view comes and goes in portrait. Any ideas? Thanks in advance!

    Read the article

  • How to push this view controller ?

    - by hib
    Hello all, I am caught in a strange requirement .See the following view hierarchy and scenario . I have a tab bar application in which I have three tabs . In first tab I am showing some content with a small image title and date (uitableview in navigation controller). In the detail view of that controller there are more buttons that shows different sorts of detail like gallery button and , more details button and some , more button . On tapping each button I will push each individual view controller in the main navigation controller . Now on the horizontal orientation I am showing same list of content but in the cover flow ( in modal view controller ) fashion like the ipod application . On tapping any image we will show the same buttons like gallery and more details and tapping on it will show the new controller with the following code : UINavigationController *modalNavController = [[UINavigationController alloc] initWithRootViewController:myPhotoController]; UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(backButtonPressed)]; myPhotoController.navigationItem.leftBarButtonItem = backButton; [backButton release]; if([self.modalViewController isViewLoaded]){ [self dismissModalViewControllerAnimated:YES]; } modalNavController.navigationBar.barStyle = UIBarStyleBlackOpaque; [self presentModalViewController:modalNavController animated:YES]; [modalNavController release]; All this is working nicely . but when I get back the device in vertical orientation . the main modal controller will be dismissed and all the containing modal controller also will be dismissed if they are open or not . Instead of this what I want is If chooses an item in the coverflow and then if chooses gallery and if I put the device in vertical orientaion the gallery should be in the navigation hierarchy that drove me to the main list and gallery should be in horizonatal fashion . So what I want to do is that just to push the gallery controller in the main navigation hierarchy instead of showing from a madal controller . If someone wants reference then see the application "net a porter" I want to do like that . Just tell me how the controller hierarchy is working in that app . I need the help . Thanks

    Read the article

  • Application tried to present modally an active controller ios

    - by Matthew
    I was trying to set the ViewController with a parent view controller before it shows show that it can provide call backs, I done this using PrepareForSegue - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"newQuarter"]) { [segue.destinationViewController setParentViewController:self]; } } It crashed giving me the error message: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller. So I tried using another method and set up a new view controller on the button touches up, - (IBAction) buttonClicked { NewViewController *newController = [[NewViewController alloc] init]; [newController setParentViewController:self]; [self presentViewController:newController animated:YES completion:nil]; } but with no luck it is still giving me the same error message, can anyone please advice? Thanks!

    Read the article

  • Clear UIWebView content upon dismissal of modal view (iPhone OS 3.0)

    - by Ricky
    I currently have a UIWebView that is displayed within a modal view. It is basically a detail view that provides a view of a page when the user clicks a link. When the view is dismissed and then brought up again (when the user clicks another link), the previously-loaded content is still visible and the new content loads "on top" of the last content. This makes sense because the instance of the UIWebView persists between sessions and is only released when the memory is needed. However, I would like to completely clear the UIWebView when the modal view is dismissed so that 1) content is cleared and 2) memory is freed. Thus far my research and attempts have not found an answer. These links haven't worked for me: http://stackoverflow.com/questions/2184688/is-it-possible-to-free-memory-of-uiwebview http://stackoverflow.com/questions/2311564/reused-uiwebview-showing-previous-loaded-content-for-a-brief-second-on-iphone I've tried [[NSURLCache sharedURLCache] removeAllCachedResponses]; and setting the webView to nil and manually releasing the webView upon modal-view-dismiss to no avail. Any thoughts from the wizened masses?

    Read the article

  • Presenting UINavigationController modally -- problem setting up tool and nav bar items in root view controller viewDidLoad

    - by Bogatyr
    In my iOS app I'm creating and presenting a UINavigationController modally like so: MyViewController *myvc = [[[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil] autorelease]; UINavigationController *navVC = [[[UINavigationController alloc] initWithRootViewController:myvc] autorelease]; [self presentModalViewController:navVC animated:YES]; In the MyViewController viewDidLoad I'm creating and setting toolbar items for the navigation controller's toolbar, like so: self.navigationController.toolbar.items = [NSArray arrayWithObjects:(items...), nil]; the problem I'm having is that the items don't show up. If instead I call a method from MyViewController's viewDidLoad method that adds the toolbar items via performSelector:withObject:afterDelay:0, then it works perfectly. So there's obviously some race condition going on here with the initial presentation of the UINavigationController, initialization of its toolbar/navbar, and the initialization of the nav bar's specified initial root view controller. I verified in the debugger that the root view controller's viewDidLoad is called after the UINavigationController's viewDidLoad method. In fact, the root view controller's viewDidLoad method is not called until presentModalViewController: is called, and the UINavigationController's viewDidLoad is called within initWithRootViewController, so doesn't that imply that the UINavigationController object should be "all ready to go", including its nav bar and toolbars? I thought at first that the navigation controller's toolbar object may not exist yet at MyViewController's viewDidLoad time, but it clearly does. At least, NSLog shows that it is not nil during MyViewController's viewDidLoad method. In fact, the UINavigationController's toolbar object is identical at both times: in the root view controller's viewDidLoad, and in the "setupToolbar" method that I called with performSelector:withObject:afterDelay, so it's not getting "re-initialized" somehow. So, what's going on here? Why aren't my toolbar modifications "sticking" in MyViewController's viewDidLoad, and why does performing them in the next iteration of the runloop (performSelector:withObject:afterDelay:0) make it work? What is the "right" way of setting up initial navbar / toolbar items in code from the rootViewController of the UINavigationController?

    Read the article

  • How to HIDE the iPad keyboard from a MODAL view controller?

    - by Cal
    I'm trying to hide the iPad keyboard from a modal view controller but it doesn't work. I have tried resignFirstResponder but that doesn't have any affect if we are in a modal view controller. I tried resignFirstResponder in a non-modal UINavigationController with the very same UIViewController and the keyboard hides correctly. Does anyone know how solve this problem? Thanks. [Update] it looks like there's something wrong with my code because the resignFirstResponder does work (I made a simple test case instead of using my code). But I still don't know what the problem is.

    Read the article

  • Can I include a NSUserDefault password test in AppDelegate to load a loginView?

    - by Michael Robinson
    I have a name and password in NSUserDefaults for login. I want to place a test in my AppDelegate.m class to test for presence and load a login/signup loginView.xib modally if there is no password or name stored in the app. Here is the pulling of the defaults: -(void)refreshFields { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; usernameLabel.text = [defaults objectForKey:kUsernameKey]; passwordLabel.text = [defaults objectForKey:kPasswordKey]; Here is the tabcontroller loading part: - (void)applicationDidFinishLaunching:(UIApplication *)application { firstTab = [[FirstTab alloc] initWithStyle:UITableViewStylePlain]; UINavigationController *firstNavigationController = [[UINavigationController alloc] initWithRootViewController:firstTab]; [firstTab release]; secondTab = // EDITED FOR SPACE thirdTab = // EDITED FOR SPACE tabBarController = [[UITabBarController alloc] init]; tabBarController.viewControllers = [NSArray arrayWithObjects:firstNavigationController, secondNavigationController, thirdNavigationController, nil]; [window addSubview:tabBarController.view]; [firstNavigationController release]; [secondNavigationController release]; [thirdNavigationController release]; [self logout]; [window makeKeyAndVisible]; Here is where the loginView.xib loads automatically: - (void)logout { loginViewController = [[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil]; UINavigationController *loginNavigationController = [[UINavigationController alloc] initWithRootViewController:loginViewController]; [loginViewController release]; [tabBarController presentModalViewController:loginNavigationController animated:YES]; [loginNavigationController release]; } I want to replace the above autoload with a test similar to below (that works) using IF-ELSE - (void)logout { if ([usernameLabel.text length] == 0 || [passwordLabel.text length] == 0) { loginViewController = [[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil]; UINavigationController *loginNavigationController = [[UINavigationController alloc] initWithRootViewController:loginViewController]; [loginViewController release]; [tabBarController presentModalViewController:loginNavigationController animated:YES]; [loginNavigationController release]; }else { [window addSubview:tabBarController.view];} Thanks in advance, I'm totally lost on this.

    Read the article

  • Modal View Controller with keyboard on landscape iPad changes location when dismissed

    - by Roi
    I present a modal view controller on my on my iPad with UIModalPresentationFormSheet presentation style and UIModalTransitionStyleCoverVertical transition style. The Modal View Controller contains a UIWebView with some TextFields on it. When the user taps one of the text fields the keyboard comes up. I have noticed that in landscape mode after the keyboard is shown, if I try to dismiss the modal view controller with animation the view changes its position from the center of the screen to the left side just before the animation starts.. This happens only if the keyboard is up and only in landscape mode on the iPad. If the user closes the modal view without pressing on any text field this doesn't happen. Anyone familiar with this strange behavior?

    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

  • How to present the same modalView after dismissing it once

    - by David Casillas
    I'm having some problem trying to present a modal view controller after it has been presented the first time, so I just start a little test method, it presents, dismisses and presents again the same controller modally. // This is just test Code. MYViewController *vc = [[MYViewController alloc] init]; [self presentModalViewController:vc animated:YES]; [self dismissModalViewControllerAnimated:YES]; [self presentModalViewController:vc animated:YES]; I get the error: 2011-11-15 09:50:42.678 Proyecto3[1260:11603] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller <RootViewController: 0x6d9d090>.' The documentation does not add any clue here.

    Read the article

  • presenting modal views in a popover

    - by sengbsd
    Hi, Im trying to load a modal view from a view controller that is displayed in a popover. The modal view loads but the problem is that it transitions into the main view and not within the popover. Is it something Im missing? I thought simply initiating it from a vc within a popover would present the modal view within the same popover... The code is nothing special as bellow: - (IBAction)myButton{ ModalVC *controller = [[ModalVC alloc] initWithNibName:@"ModalVC" bundle:nil]; [self presentModalViewController:controller animated:YES]; [controller release]; }

    Read the article

  • How can I present a modal view controller after selecting a contact?

    - by barfoon
    Hey everyone, I'm trying to present a modal view controller after selecting a contact and it doesnt seem to be working. In my - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person method, I dismiss peoplePicker, create an instance of my new view controller, then present it with [self.navigationController presentModalViewController:newController animated:YES]; and it doesnt work. However if i PUSH the view controller it works with this code: [self.navigationController pushViewController:newController animated:YES]; How can I accomplish this? Thank you,

    Read the article

  • How do you pop a modal view and the previous navigation controller view at once?

    - by mr_kurrupt
    I haven't found anything similar to this on google or stack overflow... What I'm trying to do is pop a modal view and the previous view at the same time. For example, look at the calendars app. When you are on the 'Edit' screen and select 'Delete Event', you are taken back to the calendar view. The 'Edit' screen, which was presented modally is popped as well as the the 'Event' screen (where the user is just viewing the calendar event). The problem I am having is that I know how to pop a modal view...but from the same UIViewController subclass ('Edit' screen in this example), how do I pop a view that isn't modal? I was thinking about popping the modal view as you would normally, then posting an NSNotification to the 'Event' (for instance) screen's UIViewController subclass and telling it to pop that view as well. The other thing is that for the animation, it should be the dismissModalViewControllerAnimated animation (slide down) and not the popViewControllerAnimated animation (slide left). Thanks.

    Read the article

  • Including a NSUserDefault password test in 1st Tab.m to load a loginView gives eror?

    - by Michael Robinson
    I have a name and password in NSUserDefaults for login. I have this in my 1stTab View.m class to test for presence and load a login/signup loginView.xib modally if there is no password or name stored in the app. Here is the pulling of the defaults: -(void)refreshFields { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; usernameLabel.text = [defaults objectForKey:kUsernameKey]; passwordLabel.text = [defaults objectForKey:kPasswordKey]; { Here is the Test: - (void)viewDidAppear:(BOOL)animated { [self refreshFields]; [super viewDidAppear:animated]; if ([usernameLabel.text length] == 0 || [passwordLabel.text length] == 0) { LoginViewController * vc = [[[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil] autorelease]; [self presentModalViewController:vc animated: false]; } else { [[self tableView ]reloadData]; } } Thanks in advance, I'm getting this error in the console: * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key usernameLabel.'

    Read the article

  • Password test in 1st Tab.m to load a loginView gives class error?

    - by Michael Robinson
    I have a name and password in NSUserDefaults for login. I have this in my 1stTab View.m class to test for presence and load a login/signup loginView.xib modally if there is no password or name stored in the app. Here is the pulling of the defaults: -(void)refreshFields { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; usernameLabel.text = [defaults objectForKey:kUsernameKey]; passwordLabel.text = [defaults objectForKey:kPasswordKey]; { Here is the Test: - (void)viewDidAppear:(BOOL)animated { [self refreshFields]; [super viewDidAppear:animated]; if ([usernameLabel.text length] == 0 || [passwordLabel.text length] == 0) { LoginViewController * vc = [[[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil] autorelease]; [self presentModalViewController:vc animated: false]; } else { [[self tableView ]reloadData]; } } Thanks in advance, I'm getting this error in the console: * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key usernameLabel.'

    Read the article

  • iOS: display modal view over the top of a UIWebView

    - by Sly
    Is it possible to display a modal view over the top of a UIWebView? I have a UIViewController that loads a WebView. I then want to push a Modal View Controller over the top so that a modal view covers up the WebView temporarily... The WebView is working fine; here's how it's loaded in the View Controller: - (void)loadView { // Initialize webview and add as a subview to LandscapeController's view myWebView = [[[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]; myWebView.scalesPageToFit = YES; myWebView.autoresizesSubviews = YES; myWebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); myWebView.delegate = self; self.view = myWebView; } If I attempt to load a Modal View controller from within viewDidLoad, however, no modal view appears: - (void)viewDidLoad { [super viewDidLoad]; // Edit dcftable.html with updated figures NSMutableString *updated_html = [self _updateHTML:@"dcftable"]; // Load altered HTML file as an NSURL request [self.myWebView loadHTMLString:updated_html baseURL:nil]; // If user hasn't paid for dcftable, then invoke the covering modal view if (some_condition) { LandscapeCoverController *landscapeCoverController = [[[LandscapeCoverController alloc] init] autorelease ]; [self presentModalViewController:landscapeCoverController animated:YES]; } } I suspect that there's something that needs to be done with the UIWebView delegate to get it to receive the new modal view...but can't find any discussion or examples of this anywhere...again, the objective is to invoke a modal view that covers over the top of the WebView. Thanks for any thoughts in advance!

    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

1 2  | Next Page >