uiviewcontroller

`unrecognized selector sent to instance <OBJ_ADR>`after sending `dismissViewControllerAnimated:completion` to a UIViewController

别等时光非礼了梦想. 提交于 2019-12-29 09:19:29
问题 Lots of similar questions but non with a solution that works in my case. I try to write a simple FlipSideApp. Just two views with a single button each (flipBtn | flopBtn) to present the other view vice versa. flip on the first view works fine. flop on the other view causes a unrecognized selector sent to instance 0x6c3adf0 . The App crashes after calling [self dismissViewControllerAnimated:YES completion:nil]; in file FlipSide.m (see code below). Where 0x6c3adf0 is the current address of self

What is the difference between UIView and UIViewController?

半世苍凉 提交于 2019-12-29 07:13:27
问题 I need a detailed explanation on the following: What do we use a UIViewController for? What is the use of it? I have a class that looks like the following: class one { UINavigationController *nav = ...; two *secondObject = ...; // By use of it, I have push the new view class two//ok } class two { ... } How can I use secondObject in the class one ? What is the class hierarchical start from the window? 回答1: The UIViewController is the controller part in the MVC design pattern. Model <------->

What is the difference between UIView and UIViewController?

余生颓废 提交于 2019-12-29 07:13:10
问题 I need a detailed explanation on the following: What do we use a UIViewController for? What is the use of it? I have a class that looks like the following: class one { UINavigationController *nav = ...; two *secondObject = ...; // By use of it, I have push the new view class two//ok } class two { ... } How can I use secondObject in the class one ? What is the class hierarchical start from the window? 回答1: The UIViewController is the controller part in the MVC design pattern. Model <------->

Best Method to Show a Popup Transparent Window on iPhone?

别说谁变了你拦得住时间么 提交于 2019-12-29 05:34:30
问题 I'm building an iOS 6 iPhone app in Xcode 4.6 and am wondering about the best way to achieve the following type of popup window: Specifically, the iPhone screenshot on the right, where, if a user taps on a face or UIView in the main window, a partially transparent popover appears with more detailed information -- such as a portrait photo and textual data -- but the original view (a photo collection here) remains visible, and the timers/counters continue ticking down in that view. I thought

Push View Controller, Black Screen

泄露秘密 提交于 2019-12-29 03:54:08
问题 I'm pushing to a new view controller and passing some data to it. When I run the application I can press the button and push to a new view but the screen is completely black. Any help is appreciated. - (IBAction)button:(id)sender { NSString *firstField = self.field.text; NSString *secondField = self.field2.text; self.resultsArray = [[NSArray alloc] initWithObjects:firstField, secondField, nil]; NSUInteger randomResult = arc4random_uniform(self.resultsArray.count); self.label.text = [self

Is it possible to push a View Controller with a completion block?

时光怂恿深爱的人放手 提交于 2019-12-29 03:31:08
问题 UINavigationController's documentation contains no pushViewController methods with a completion: parameter. 回答1: I would go with @justMartin's answer . But below is another approach. push animation take 0.3 seconds.So, if you want to run some function here after completion use performSelector after 0.3 seconds of delay. [self performSelector:@selector(completedPushing:) withObject:nil afterDelay:.3]; OR After pushing the new viewController onto navigation stack ,the old viewController view is

Unable to programatically create a UIViewController in Swift

爱⌒轻易说出口 提交于 2019-12-29 01:37:14
问题 When I try to create an instance of a UIViewController in Swift , all the inherited initialisers are unavailable, even though I didn't define any designated inits in the view controller (or anything else, FWIW). Also, if I try to display it by making it the root view controller, it never gets displayed: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. window

Setting property value of parent viewcontroller class from child viewcontroller?

时光总嘲笑我的痴心妄想 提交于 2019-12-28 18:49:09
问题 Does anyone know how to update a property value from the subview (child) view controller? I have a int property called statusid defined with gettor/settor in parent view controller. [self.view addSubview:detailsVC.view]; In the child subview, I trying calling [super statusid:updatedValue]; to update statusid to a new value, but this creates an error. How can i update statusid in the parent? Anyone know how to do this? 回答1: with "super" you access your base class, the one your current class

Can't cast value of type UIViewController to PatternDetailViewController

六眼飞鱼酱① 提交于 2019-12-28 14:01:12
问题 Am trying to downcast a view controller to a detail view controller but can't. Am using Core Data (for the first time). The error is in the prepareForSegue method and reads: "Could not cast value of type 'UIViewController' (0x1b81cdc) to 'Patternz.PatternDetailViewController' (0x32488). (lldb) " Would appreciate an explanation of why it doesn't work. Here are the files. ViewController.swift import UIKit import CoreData class ViewController: UIViewController, UITableViewDataSource,

iPhone App Crash with error [UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:]

这一生的挚爱 提交于 2019-12-28 06:32:07
问题 I have an iPhone App in the app store which is using Touch ID. If Touch ID is enabled, the user is authenticated with it, else user needs to enter his PIN to login to the application. After IOS 10.1 release, when I checked the crash report, the crash count has increased. From the crash report, it is pointing on [UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] and when I opened the app in Xcode, it is focussing on [self dismissViewControllerAnimated:YES completion:nil]; . The