segue

Xcode - Segue issues

左心房为你撑大大i 提交于 2020-02-16 06:34:11
问题 i've been trying to get a segue to work. I've written the following... but for some reason, the ...preparesegue... method doesnt fire. I've read other related posts but i cant get it to fire, and just as importantly, the variable i'm need isnt transferred. m file: @implementation CountryTableViewController -(void) getData:(NSData *) data { NSError *error; json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error]; [self.tableView reloadData]; } -(void) start { NSURL

“fatal error: unexpectedly found nil while unwrapping an Optional value” while calling a protocol method

三世轮回 提交于 2020-02-08 08:50:30
问题 I've implemented a protocol to get some sort of message, that a game has already finished and passes the time to my controller (Game wrote in SpriteKit). But now I'm having this fatal error after finishing the game and executing the gameEnded method and the app just crashes. Does anyone know why? Here is my code GameViewController class AcceleratorGameController: UIViewController { var time: Float = 0.0 var challengeController: ChallengeViewController! weak var delegate : GameEnded? override

Login Failure Still Segues to Next View Controller

99封情书 提交于 2020-02-05 05:18:07
问题 Though I've successfully done this before, I can't figure it out this time. I've got a basic login screen as the first VC loaded upon launch. Successful login (appropriate username/password combo from database) does appropriately allow access without any alerts. However...any incorrect combination (or no username/password at all, for that matter), results in my desired alertView, but the next VC loads anyway. What am I doing wrong? There should be no segue at all upon failure, just an alert.

Xamarin.iOS Designer - Creating Action segue not working

倖福魔咒の 提交于 2020-02-05 02:01:06
问题 I am trying to add action segue by dragging a button on one screen to another in Xamarin Studio on Mac. According to instruction provided by Xamarin university, this should create action segue. My exact steps are Click on Control key Select button on 1st screen Drag it to the 2nd screen Release mouse and Control key This should show a little popup prompting you to select type of segue (Push, Modal, or Custom). In my case, the popup shows very briefly, so I have no time to select the type. 回答1

performSegueWithIdentifier very slow when segue is modal

不羁的心 提交于 2020-01-27 00:01:13
问题 I have a simple table view where I handle the select action on the table view. This action follows a segue. If the segue is a push segue, the next view shows immediately. If the segue is a modal segue, the next view either: takes 6 seconds or so to display shows immediately if I tap again (second tap) I tried looking around for some ideas, but none seem applicable to my situation. In particular: I'm performing the segue on the main UI thread My view is very simple (so there's no issue in

iOS 7: Keyboard not showing after leaving modal ViewController

不羁的心 提交于 2020-01-25 11:52:28
问题 I've got a HomeViewController that has different modal segues to several other UIViewControllers . If I try to show the keyboard on a UITextField within the HomeView, everything works fine. However, if I try to show the keyboard on a UITextField (using becomeFirstResponder ) after returning from any of the modal View Controllers, the keyboard never shows. Here's some sample code from one of the setups I've tried: In HomeViewController : - (void)viewDidAppear:(BOOL)animated { static BOOL

iOS 7: Keyboard not showing after leaving modal ViewController

戏子无情 提交于 2020-01-25 11:51:23
问题 I've got a HomeViewController that has different modal segues to several other UIViewControllers . If I try to show the keyboard on a UITextField within the HomeView, everything works fine. However, if I try to show the keyboard on a UITextField (using becomeFirstResponder ) after returning from any of the modal View Controllers, the keyboard never shows. Here's some sample code from one of the setups I've tried: In HomeViewController : - (void)viewDidAppear:(BOOL)animated { static BOOL

Segue not setting value to detail view controller

你离开我真会死。 提交于 2020-01-25 11:03:05
问题 I have a Master-Detail VC set up and I've figured out how to set up a segue to my Detail VC. The code below doesn't crash, but it also doesn't send a value for the label to the VC I'm pushing to. I'm stumped as to how I pass the value of detailViewController.detailItem = selectedNote?.noteBody to my DetailViewController . The code below compiles. It does not crash. But it also doesn't set anything on my DetailViewController . override func tableView(tableView: UITableView,

tap button cause app crash on side bar

旧时模样 提交于 2020-01-25 05:26:26
问题 I have two view controllers, one is the home view, one is the side menu view; all of the objects and created with storyboard. there is a bar button 'item' on home view, when clicking it, it will invoke a custom segue, to slide out the side menu from left to right. So far so good. On side menu, there is a button to slide back to home view. However, I simply click the button, the app will terminated, Xcode does not print out the crash log overtime. I tried to add a breakpoint on (IBAction

Double Tap Segue to move to next storyboard

匆匆过客 提交于 2020-01-24 19:28:49
问题 I am making an app where the user has to double tap a segue to move to the next storyboard, but I cannot find anywhere where it tells you how to do this. Does anyone know how I can achieve this? 回答1: If you do this in Interface Builder with a storyboard: Drag a tap gesture recognizer from the object library onto your view. Make sure the view you dragged it to has "user interaction enabled" checked. Select the tap gesture you added to your scene (which you can find in your document outline on