uiviewcontroller

How Do I Initialize Two Instances of NSObject in the same ViewController - Swift

試著忘記壹切 提交于 2019-12-23 03:14:09
问题 Please bear with me. I'm new to programming and new to StackOverflow. I hope that my question will grant me a warm response for entering the programming community. An acquaintance, whose opinion I trust, told me to post this email to him on StackOverflow. What do I have to do to get two instances of NSObject to work in the same ViewController? I've initialized an NSObject subclass called SideBar and RightSideBar. They both draw from NSObject. The cells in the menu are called created by a

iPhone: How I can Access Data in a View Controller Class from Another Controller Class?

那年仲夏 提交于 2019-12-23 03:13:17
问题 In my application I have one Entry form in which there are six Text fields Name :UITextField Date of Birth :UITExtField Age:UITextField Address :UITextField Phone No :UITextField Image : UIIMageView Now What I want is that I want all these fields value in the same fields of other ViewController class. How it could be possible . Please help me I really need help for this.. Special Thanks in Advance 回答1: You can achieve that by implementing getter and setters in the delegate class. In delegate

Swift: Instantiate a view controller for custom transition in the current navigation stack

点点圈 提交于 2019-12-23 02:58:12
问题 Introduction I'm creating an app that has, in its rootViewController, a UITableView and a UIPanGestureRecognizer attached to a small UIView acting as a "handle" which enables a custom view controller transition for a UIViewController called "SlideOutViewController" to be panned from the right. Issue I have noticed two issues with my approach. But the actual custom transition works as expected. When the SlideOutViewController is created it is not attached to the navigation stack I believe,

How to present login screen only when a userdefaults key doesn't exist?

折月煮酒 提交于 2019-12-23 02:57:06
问题 I am trying to develop an application (still learning) where i present a logon screen which takes a username and password - this then goes off to a web service to authenticate and returns an access token. The access token is then stored in userdefaults and then presents a new view controller which gives access to the secured data. My problem is that when i close my app - force close, it then asks to login again. Because my login view controller is the initial view controller then i added a

Make UIViewController outside Navigation Controller

爷,独闯天下 提交于 2019-12-23 02:47:09
问题 i have a question for you. I'm working on this app that has a walkthrough/tutorial screens and also login ones. On each of this screens there is a button to skip this part and go directly to use the app, without completing the registration (you know, so that people can test it before signing-in). As you can see i'm using Storyboards. The NowPlaying04 ViewController is actually the app itself. Obviously, when the user will be a registered one, i should also be able to jump right back to that

-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance

久未见 提交于 2019-12-23 02:47:08
问题 I am very new to Swift as I justed started on it only a few months back. I have an aching problem with this error. -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance XXX Here is a list of possible fixes that I have so far gathered and implemented already. I have changed the Custom Class to CheckboxQuestion class instead of the UIViewController class. Custom Class I have connected the tableview to the datasource and delegate. I have accounted for all

Releasing memory of multiple view controllers inside a scrollview

房东的猫 提交于 2019-12-23 02:39:31
问题 I have an app the loaded many view controllers in a scroll view depending on the number of objects the user has in a tableview. So when I flip between the tableview and the scroll view, the number of view controllers in the scroll view changes according to how many objects the user has in the tableview. I use the code in Apple's PageControl sample code to build the scroll view with many view controllers inside it, after some modification of course. - (void)loadScrollViewWithPage:(int)page {

How to show iAd in all screens with single reference while using storyboard?

馋奶兔 提交于 2019-12-23 02:21:40
问题 How can one implement iAd in such manner that it is implemented in only AppDelegate and can be used in all screens. I put code in appDelegate.Do i still need to code for it in each view controller? AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self addiAd]; NSLog(@"window subview : %@",self.window.subviews); //Here it shows no subview return YES; } -(void)addiAd { self.adView.delegate = self; self.adView

iOS8 issue when trying to push multiple UIViewControllers in NavigationController

血红的双手。 提交于 2019-12-23 02:21:32
问题 I have 6 UIViewControllers connected with push segues with identifiers and a functionality in my app to 'jump' to the desired UIViewController using this method for stacking ViewControllers: - (void) JumpTo6 { UINavigationController *nav = self.navigationController; UIViewController *a =[self.storyboard instantiateViewControllerWithIdentifier:@"2"]; [nav pushViewController:a animated:NO]; UIViewController *b =[self.storyboard instantiateViewControllerWithIdentifier:@"3"]; [nav

Refresh tableview after delete a tableview cell and refresh view controller

前提是你 提交于 2019-12-22 19:40:11
问题 I need answer for swift by the way. Basically, I have two questions for refreshing. If you think the code is too long to look at, this is what I'm trying to do. one is to refresh the tableview after clicking on the delete button on one of the tableview cell. I've tried refreshcontrol, it didn't work and it wasn't what I wanted but it would be cool to have them. My other question is, how to refresh a view controller by clicking on of the buttons. And here is the code. The delete button is