modalviewcontroller

Passing NSMutableArray from Modal View Controller to Parent View

两盒软妹~` 提交于 2019-12-25 14:23:43
问题 I'm struggling to pass a NSMutable array from a Modal View controller back to the view controller I came from. This is my current method: FirstViewController.h #import "SecondViewController.h" @property (strong, nonatomic) IBOutlet NSMutableArray *passedRecipientsArray; FirstViewController.m @synthesize passedRecipientsArray = _passedRecipientsArray; - (void)viewDidAppear:(BOOL)animated { NSLog(@"passedRecipientsArray: %@", self.passedRecipientsArray); } - (void)prepareForSegue:

Access to an IBOutlet in a modal view's parent view

孤人 提交于 2019-12-25 08:39:47
问题 I have an iOS app where my architecture is: VC1 => MVC1 I want to access to an VC1's IBOutlet (aboutBtn). I tried making a delegate in MVC1 and setting VC1 as delegate, but I still can't access it. How would I do it? 回答1: I would just create an instance variable in MVC1 and pass the IBOutlet variable you're trying to access from VC1 to MVC1. For example, you could call something like MVC1.referenceToSomeIBOutlet = self.someIBOutlet from VC1. That will give MVC1 access to the passed in

iPhone - modalViewController release

百般思念 提交于 2019-12-25 08:13:02
问题 I try to find proper way of releasing modal view controller. Basically, I have view controller, which presents modal view (fullscreen) after button is pressed. TipViewController * tipViewController = [[TipViewController alloc] init]; tipViewController.delegate = self; [self presentModalViewController:tipViewController animated:YES]; Then, in modal view when it should be dissmissed I call: [self.delegate didDismissModalView]; Finally, the didDissmissModalView method of parent controller is

Warning: Attempt to present *** whose view is not in the window hierarchy

前提是你 提交于 2019-12-25 07:12:56
问题 I'm receiving this error when I am using an attached long press gesture to get a modal view to come up using the following code: // Long press to go to settings for one - (void)longPressOne:(UILongPressGestureRecognizer*)gesture { [self performSegueWithIdentifier:@"buttonOne" sender:self]; } // Long press to go to settings for two - (void)longPressTwo:(UILongPressGestureRecognizer*)gesture { [self performSegueWithIdentifier:@"buttonTwo" sender:self]; } - (void)viewDidLoad { // Add gesture to

delegation issue with dismissing multiple view controllers

南楼画角 提交于 2019-12-25 05:30:20
问题 I asked a question about dismissing multiple view controllers previously and the answers that i was given along with the possible solutions i found elsewhere have all failed to achieve the desired effect. i have narrowed down my issue to something with the way i set up my delegation. the code is below and i would really appreciate any feedback. my full project can be downloaded here: https://www.yousendit.com/download/TEhWckhYQVNYSHpIRHNUQw Thanks. // // QuestionViewController.h //

Pass a NSString from Child to Parent for ModalViewController

落花浮王杯 提交于 2019-12-25 04:47:09
问题 My parent ViewController class contains a UISearchBar. I have a UIButton that will push on a new ViewController via the code below AddViewController *addViewController = [[AddViewController alloc] initWithNibName:@"AddView" bundle:nil]; [self presentModalViewController:addViewController animated:YES]; [addViewController release]; In the AddViewController the User is presented with a TableView of animal names. On the - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:

Lag / Delay on ModalViewController dismiss after loading an xib view over SKView

你说的曾经没有我的故事 提交于 2019-12-25 04:06:55
问题 Imagine this scenario (some code below): I have an SKView on a viewcontroller. I load an xib view (external .xib file) over skview (xib view is a like small menu view that does not cover screen in full). Then, I show a view controller modally from SKView's controller When I dismiss this modal view controller, there is a lag on every second dismissal (so, i show it modally, dismiss, it is fine, then i repeat, there is delay, then repeat, works fine, then do again, there is delay ... and so on)

Using MFMailComposeViewController without presenting the view controller

本秂侑毒 提交于 2019-12-25 02:43:36
问题 I am using MFMailComposeViewController to send an email with an attachment. In all the guides it chooses to present the view controller as a modal view so that the user can change the fields and choose to send or cancel. I don't want people to be able to change the information that I have put in, so I was wondering if I could force it to send the email without going to the modal view? I am aware of using a url with mailto but believe you can't add an attachment. If anyone knows if this is

performing programmatic segue after unwind

♀尐吖头ヾ 提交于 2019-12-25 02:28:37
问题 I have two View Controllers, V1 and V2. V1 presents V2 with a modal segue in storyboard. I then have an unwind segue that dismisses V2 to go to V1. The Done action belowed is then called. It prints out the correct NSLog's, however the [self performSegueWithIdentifier:@"viewmessagessegue" sender:self] does not get initiated. I use that same line of code when a button in V1 is pressed, and it works correctly in that scenario. I'm confused as to why it's not being called... - (IBAction)done:

Layout issues when presenting a view controller with UIModalPresentationStyleCurrentContext

痴心易碎 提交于 2019-12-25 01:33:38
问题 I ran into a problem having to do with UISplitViewController and modal view controllers on the iPad, so I tried to reproduce the issue in a small project to see if I could figure out what was going on. Unfortunately, the problem seems to still be occurring, but I can't figure out why. I've included a very small, complete Swift program below that reproduces the problem. Basically, if you run that code in a new Swift iOS project on the iPad, you'll see the following behavior: The app will start