uiviewcontroller

How can I pass an NSString from one View Controller to another?

强颜欢笑 提交于 2019-12-22 18:51:57
问题 I made a very simple storyboard based project with two View Controllers. I want to simply access a string declared in VC1 from VC2. The second VC should then display the text in a textfield upon the press of a button. I do not want to use delegation , a separate class for global data or global variables and Extern . Instead, I read that it was easy to achieve variable sharing using a reference to one VC in the other. For my code shown below, XCode didn't complain, however my problem is this:

How can I pass an NSString from one View Controller to another?

青春壹個敷衍的年華 提交于 2019-12-22 18:51:12
问题 I made a very simple storyboard based project with two View Controllers. I want to simply access a string declared in VC1 from VC2. The second VC should then display the text in a textfield upon the press of a button. I do not want to use delegation , a separate class for global data or global variables and Extern . Instead, I read that it was easy to achieve variable sharing using a reference to one VC in the other. For my code shown below, XCode didn't complain, however my problem is this:

pushViewController with tableViewController in viewController

守給你的承諾、 提交于 2019-12-22 18:04:09
问题 I have an UIViewController, this controller is contained in a navigationController. I add an UITableViewController in this viewController. I would like to call a pushViewController method when I press on a cell of my tableView. I tried this : UITableViewController - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { FirstView *myViewController = [[FirstView alloc] init]; [f myViewController]; } UIViewController (FirstView) -(void)pushIt { SecondView

pop and refresh viewcontroller

夙愿已清 提交于 2019-12-22 17:42:11
问题 I have three viewcontroller. when I get to the third viewcontroller, I use poptorootviewcontroller to pop to my first view controller, but when I use popviewcontroller in my third viewcontroller (i want to go back to my second viewcontroller) its poping but all the info that I edit in my second viewcontroller are there, and I want the secondviewcontroller to be new (reset this viewcontroller), like this viewcontroller to be reloaded. here is my code in the third viewcontroller: -(IBAction

how to custom back button in storyboard

一世执手 提交于 2019-12-22 16:02:09
问题 I create one application that has 3 ViewController with names : (ViewController,ViewController2,ViewController3) in ViewController exist one button that is for checking file in document folder or download it.for example first to check file if file exist in document folder go to ViewController3 else go to ViewController2 and download it. so ViewController2 is for download and has UILable & UIProgress for show download status.if file dont exist in this page downloaded and go to ViewController3.

Use Background Image to UINavigationController among multiple views

。_饼干妹妹 提交于 2019-12-22 13:56:49
问题 How can I use a background image for UINavigationController, while maintaining the title? The answer from ck on other thread did the trick to put the image and keep the text. But if the user navigates to other view ( using [navigationController pushViewController]), only the background appears in the new screen. How can one change the background image for UINavigationController, while maintaining the title across multiple views? 回答1: create a CustomUIViewController that extends

UITableView : popViewController and keep row index into parent controller?

大城市里の小女人 提交于 2019-12-22 11:16:19
问题 I have the following config : A ViewController parentController containing a TableView parentTable with customized cells to display 2 labels in each of them. A ViewController childController containing a TableView childTable . This view is displayed when the user clicks a cell of controllerParent, and childTable content depends on the selected parentController cell. I use this method : [self.navigationController pushViewController:controleurEnfant animated:YES]; Now when I click a cell in

Adding an SKScene to a UIViewController?

我是研究僧i 提交于 2019-12-22 11:01:01
问题 I just created a new UIViewController in interface builder. It is segued to from a UITableViewController (cell). I now want to work with an SKScene inside this UIViewController . How is this accomplished? And for a side-note... If the SKScene takes up the entire UIViewController.view can you overlay UIKit objects on top of the scene? Or is it better to create a separate UIView inside the UIViewController.view to hold the SKScene , then layout the UIKit objects around this separate UIView ,

Howto Update a gui (progressview) from a download delegate in swift

只愿长相守 提交于 2019-12-22 10:55:05
问题 I have a DownloadSessionDelegate Class to handle a downloadprocess for big files. I would like to show the progress in a progressview. The Information about the download state is in my DownloadSessionDelegate Class. Now I don't know howto update my progressview outside of that class. Howto to do that ? class DownloadSessionDelegate : NSObject, NSURLSessionDelegate, NSURLSessionDownloadDelegate { var handlerQueue: [String : CompleteHandlerBlock]! ... ... ... func URLSession(session:

ViewController has wrong orientation after Landscape-only has been popped

放肆的年华 提交于 2019-12-22 10:48:12
问题 In a navigation-based app, LandscapeViewController only supports landscape mode (all others support both modes). I also have a "loading screen" that advises the user to rotate the phone before continuing. This way I can make sure that when my landscape view loads, that it's in landscape mode. The problem comes when I rotate the phone to portrait mode while still showing LandscapeVC. I press the Back navigation button to navigate up one level (to a VC that supports both landscape and portrait