segue

Passing array to a segue

馋奶兔 提交于 2019-12-25 04:14:05
问题 I'm trying to pass an array from view A to segue B, here's the code: -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"B"]) { BViewController *B = [segue destinationViewController]; [B setBArray:self.AArray]; } I've declared BArray as property in BViewCOntroller: @property (retain) NSMutableArray *BArray; and synthesized it.... and the error is NSInvalidArgumentException', reason: '-[UINavigationController setBArray:]: unrecognized

If statement based on whatever the previous view controller was

无人久伴 提交于 2019-12-25 03:38:45
问题 Here is what I go so far: - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if (preivousViewController isEqualToString:@"...") { if ([self.filteredArray count] == 0) self.person = self.users[indexPath.row]; else self.person = self.filteredArray[indexPath.row]; self.mugshot = cell.imageView.image; [self performSegueWithIdentifier:@"SelectPerson" sender:self]; } else { if ([self

swift - adding values between 2 view controllers by prepareforsegue

十年热恋 提交于 2019-12-25 02:54:01
问题 I have 2 ViewControllers: ViewController1, ViewController2. An "Add" button in ViewController1 will bring up ViewController2. User will then enter in values into ViewController2 which will then be passed back into ViewController1 by prepareforsegue. These values are then append onto the properties of type array in viewcontroller1. This is being repeated, whereby the user continue pressing the add button to bring up ViewController2 from ViewController1, and then add in new values to be

Unable to segue using an accessory indicator

混江龙づ霸主 提交于 2019-12-25 01:39:33
问题 I have a segue with three transitions (see code below). The first from a button. That works perfectly. The second by tapping on the cell in a table view. That one works perfectly too. The third is an accessory button in the tableview cell. This one opens the proper view controller, but does not pass a reference to the patient as I have coded. I have verified this by an NSLog statement in the viewDidLoad of the new view controller and it shows patient as being null. -(void)prepareForSegue:

Navigation stack will not be updated, segue from GMSAutocompleteResultsViewController

守給你的承諾、 提交于 2019-12-24 20:44:55
问题 I'm having issue with segue to the existing UIViewcontroller via the pushViewController. When I'm tap on the place in resultsViewController, I expect the segue to the MainVC, but i have an error: pushViewController:animated: called on while an existing transition or presentation is occurring; the navigation stack will not be updated. How can I fix this, and have the transition to MainVC?? 回答1: Couple things: Make sure you are not "doubling up" on navigation. If you use a Segue to transition

How to detect which sequence is in page segue for WatchKit?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 18:13:50
问题 I'm trying to implement a page-based navigation app using the "Next Page Relationship Segue" described in this tutorial. In the app, both calendar views show the same type of content. The first one contains today's activities, and swiping presents the second one which contains tomorrow's activities. I'd like to re-use the same code (i.e., same class) for both interface controllers. Then, when each loads, I need to know which one it is, in order to display the activities for today or tomorrow.

Persist data and pass to multiple views

心不动则不痛 提交于 2019-12-24 14:51:38
问题 I have an app where a user logs in by entering their details and that sends a HTTP GET request to my API which authenticates the user and sends the users data/user object back from the database. Once this is done, within my HTTP request which is triggered on button tap I send the users data onto the next view and perform a transition to the view by using the following code: if let parseJSON = json { // parseJSON contains the return data. We are programmatically creating a segue between two

separate segue on section header as on table view row

懵懂的女人 提交于 2019-12-24 13:22:23
问题 I have a tableview setup whereby every row has its own custom section header. This is done with a prototype cell in the story board. I have a segue to a view controller on the click event of a row. I achieved this by ctrl dragging on the storyboard. I want my section header to segue to a different controller, however. I ctrl dragged from my header prototype cell to a view controller on the storyboard also. The result is that both clicking on the row and clicking on the header of the row are

Inhibit Storyboard Segue from performing segue action

和自甴很熟 提交于 2019-12-24 13:00:21
问题 Question How do I deny a storyboard segue from taking place? Context: I have a static grouped table view of options on the first view controller that is visible (the main menu if you will). I purposely show the UI early to give the user a chance to interact and perceive a fast load response. Other operations that might be importing data for example, happen on a background operation queue. Most of my UI functions are in fact, ready to go as soon as you see them. One menu item (table row) in

Delegation - Change variables from different viewsControllers

半腔热情 提交于 2019-12-24 12:51:18
问题 I have an UIImageView (img) on the container2View as an IBOutlet. How can I change the img.image and refresh the view from other container (containerView)? We have to use delegation mainController class mainController: UIViewController, containerDelegate { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { switch segue.identifier! { case