viewcontroller

JavaFX: How to update the center view of a borderpane with new values

∥☆過路亽.° 提交于 2019-12-12 04:53:42
问题 I am creating a program which has a row of buttons on the top, and a row of buttons on the side. The top buttons control the view, and the side buttons control what object to reference in the view. My main/root view is a borderpane. The point is to, as I click on any of these buttons, to change a value in my MainController, and then reload the center view with these new values. I thought it would be so simple as to write a method that would change the value and then set a new center according

Press a Button and open a URL in another ViewController

旧时模样 提交于 2019-12-12 04:45:43
问题 I am trying to learn Xcode by making a simple app. But I been looking on the net for hours (days) and I cant figure it out how I make a button that open a UIWebView in another ViewController :S first let me show you some code that I have ready: I have a few Buttons om my main Storyboard that each are title some country codes like UK, CA and DK. When I press one of those Buttons I have an IBAction like this: - (IBAction)ButtonPressed:(UIButton *)sender { // Google button pressed NSURL* allURLS

Pass string from tableviewcontroller to viewcontroller in navigation stack

一笑奈何 提交于 2019-12-12 04:42:48
问题 How should I pass a string to the view controller that gets pushed when a tableviewcell is selected. Should I create a custom init method in the view controller? eg [[myvc alloc]initWithURL:...] Set a property? eg [myvc setURL:...] or myvc.url = ... or just create a custom method? [myvc setLoadingURL:...] 回答1: We've actually done this both ways (with an init and a property). I found the property the best method because the custom init method may not be called if the ViewController is created

Receiving a notification without loading the view

孤者浪人 提交于 2019-12-12 03:32:47
问题 As I explained in this question, I'm trying to pass data from a UISwitch in a TableView to another ViewController. However, I want the data to be passed when the Settings View (which contains the UISwitch) is dismissed. Following the third step of this great answer, I'm using UserDefaults to pass the data and trying to use NotificationCenter to update the UserDefaults values when dismissing the Settings View. To update when user defaults values change, you could have your Settings controller

Pass NSString value to another ViewController in Objective C

℡╲_俬逩灬. 提交于 2019-12-12 03:29:31
问题 I am trying to pass NSString value to another ViewController. But I get null instead of the value. Here is my code. FirstViewController.m: NSString cellID = @"66"; SecondViewController *apiViewController = [[SecondViewController alloc] init]; apiViewController.strMessage=cellID; [self.navigationController pushViewController:apiViewController animated:YES]; SecondViewController.h: @interface SecondViewController : UIViewController{ NSString *strMessage; } @property(nonatomic,retain) NSString

Can't link connector from IBOutlet to View Controller

Deadly 提交于 2019-12-12 03:13:52
问题 I have created files AViewController.h and AViewController.m, for a view controller - I have set the custom class of this view controller to AViewController . I have an object defined in AViewController.h, which is an instance of another class B as: @property (weak, nonatomic) IBOutlet B *object_b; I want to be able to link this IBOutlet to the view controller, so that I can use it to call functions of class B to display things on the view controller. However, I'm not able to do this - trying

Adding Game Center Leaderboard

旧城冷巷雨未停 提交于 2019-12-12 02:15:59
问题 I am new to Swift and am having trouble adding a Game Center leaderboard into my Sprite Kit game. I created a button for the leaderboard but it is in an SKScene and it seems that the code for Game Center needs to be inside a View Controller? I have added the code into my single View Controller, but now I'm not sure where to go. Again, I am very new to this and completely lost -- any help would be greatly appreciated. 回答1: you could create a cocoa touch class with the UIViewController Subclass

Displaying UITableView in proper format

你离开我真会死。 提交于 2019-12-11 16:42:36
问题 I have the following code to fetch the data from URL, store it in arrays, and display it inside the table. I had some issue related to fetching and that is solved on SO Click here Now the issue is data is displayed in the table in a manner which is not the ideal one. When I run the below code, I get this output. That shaded grey portion is my main concern. When I try to insert any element say button in that grey shaded area through design view, it gets overlapped by table. If I change

iPad View Controller Memory Management

白昼怎懂夜的黑 提交于 2019-12-11 16:42:27
问题 I have 3 view controllers in my iPad app. When the first one shown up, the Activity Monitor in Instruments told me that the app's memory was 25MB. After a [self presentModalViewController] call, a new view controller popped up, the memory gone up to 50MB, and then the third one, 70-75MB. What is the best view controller memory management for the iPad development? I always receive Memory Warning now when I'm on a real iPad. Thanks in advance. I'm sorry for my English, since it's not my native

How to access the parent view controller?

最后都变了- 提交于 2019-12-11 16:38:35
问题 I am using this code to push a view controller in ViewControllerA : DatePickerViewController *viewController = [[DatePickerViewController alloc] initWithNibName:@"DatePickerViewController" bundle:nil]; NSMutableArray *info = [[NSMutableArray alloc] initWithObjects:@"Exam Duration",nil]; [viewController setInfo:info]; [info release]; [self.navigationController pushViewController:viewController animated:YES]; [viewController release]; In the DatePickerViewController that is slid in, it has a