segue

Passing Data between interface controllers in WatchKit

两盒软妹~` 提交于 2020-01-10 18:58:06
问题 How would I pass data stored in a label from my Interface Controller to another interface controller in WatchKit using Swift? I can't seem to find an answer anywhere, hope someone here can help me. I've included the section of my code that deals with calculating the value I need passed. I basically want to show the same value that was calculated by the user and elaborate more on it in the next Interface Controller named ResultsController. Any help is greatly appreciated :D class

NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController

六月ゝ 毕业季﹏ 提交于 2020-01-09 08:37:28
问题 so I'm making an app with 5 view controllers, the first is embedded in a UINavigationController and the segue between the first 4 view controllers works fine. However introducing a 5th View Controller has broken this, and I'm getting the error Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.' I havent done anything differently with this 5th view controller, its

NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController

丶灬走出姿态 提交于 2020-01-09 08:37:11
问题 so I'm making an app with 5 view controllers, the first is embedded in a UINavigationController and the segue between the first 4 view controllers works fine. However introducing a 5th View Controller has broken this, and I'm getting the error Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.' I havent done anything differently with this 5th view controller, its

How do I make multiple tableview cells to lead corresponding view controllers?

落爺英雄遲暮 提交于 2020-01-07 08:03:50
问题 I am making an app with a tableViewController as the initial view controller. It obviously has a list of items in tableview cells. I want each of the tableView cell to lead to a different View controller. Here is an example of my home screen: ![enter image description here][1] What I am trying to achieve, for example, is that the tools cell will take me to a View controller with details about tools. And when I click on weapons, it should take me to a view controller with details about weapons

Need to free memory after Modal Segues, but I need both my Segues to pass data from A to B and B to A

穿精又带淫゛_ 提交于 2020-01-07 05:03:09
问题 I am making a game for iOS with SpriteKit. I have 2 Viewcontrollers. One is the GameViewController and the other one is the MenuViewController. Let's call them A and B respectively. When the player dies, a function is called in GameScene.swift that launches a modal "Lost" Segue to B. There, the player can restart the game or buy a life and a "Back" Segue is called to A. I need to dismiss the additional Views that get created each time I call a segue. Problem is: I need the "Lost" Segue to

How to show SomeViewControler using code?

谁说我不能喝 提交于 2020-01-07 02:17:25
问题 I am brand new in Xcode and iOS development. I am trying to figure out how to open/show some view based on button click. I know that I can do this using ctrl + mouse click on some ViewController using segue but I need to add some logic before. How can I accomplish this? 回答1: There are two ways to make segues work. You can either ctrl drag from a button to a new ViewController (like you have done) or you can ctrl drag from one ViewController to a new ViewController (drag from the little orange

Change UITableViewCell height touch up inside

六眼飞鱼酱① 提交于 2020-01-06 20:35:41
问题 As the title says, I'd like to make my cells dynamically change height. I try to be as clear that I can. When I touch up inside a cell (prototype cell), the cell change height (from 44 to 88);in the cell there is an UIImage (88px height) partially hidden and where the cell is hidden there is view, touching up starts a segue to a second tableView; when I touch up inside an other cell the previous cell return to 44px height an this other cell change height as the previous one. Follow a scheme

Pushing data between UITableView and UIViewController via segue issue

纵然是瞬间 提交于 2020-01-06 06:59:53
问题 I want to push data from UITableView to a UIviewController. I want to set the counter to the value of the row selected in the UITableView and then push this value into UIViewController. The problem I have is, initially no matter what row I press in the UITableView it sets counter = 0 Then if I dismiss the ViewController to go back to the UITableView and select another row the value of counter will be equal to the previous row I selected. so it will be a press behind. How can I fix this? The

calling unwind segue from camera method fails

巧了我就是萌 提交于 2020-01-05 12:32:49
问题 My unwind segue code is working fine. I use storyboard to wire things up. And when I run the app, all is well. But in addition to clicking a button, I want to also do the unwinding from code. Basically I am presenting a modal that contains two buttons: Camera , Gallery . User clicks on one of the buttons to go to either get an image from the camera or from the gallery. So once the image is obtained, I no longer need the modal view. Hence, as the last step in the method (void

ios view controllers keep staking in memory

杀马特。学长 韩版系。学妹 提交于 2020-01-05 12:14:10
问题 I am new to Objective C. I am working on my first app. - It basically consists of 2 view controllers, and I use modal segue to switch between them. The main vc is a menu that loads up the 2nd vc with different attributes for each menu item. - I noticed that the memory keeps increasing when I switch from one vc to the other. This was my attempt to solve the issue but it doesn't make a difference and it doesn't look clean. -(void)viewDidDisappear:(BOOL)animated{ ViewController *me = self; me =