uiviewcontroller

Swift Unbalanced calls to begin/end appearance transitions for

≯℡__Kan透↙ 提交于 2019-12-23 07:45:56
问题 This has been stumping me for a while now. I have a UISplitViewController inside a UITabBarController . The master view is a TableView. When I click on a cell, I bring up a very basic view controller with just a UIButton centered. Here is the code for the view controller: class TestViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { @IBOutlet weak var button: UIButton! override func viewDidLoad() { super.viewDidLoad() } override func

How to load xib file with attached view controller?

醉酒当歌 提交于 2019-12-23 07:30:59
问题 I am using a xib file as a back view in coverflow component . and it is seeing nicely . The code for loading a xib file is : NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"TestMine" owner:nil options:nil]; backView = [array objectAtIndex:0]; Now I want to attach a view controller with this xib without changing the current code . How can I do so ? I am getting the error : Exception :*** -[UIViewController superview]: unrecognized selector sent to instance 0x5891120 Tell me if more

What is the ViewController.swift (Interface) file for - in Counterparts

ⅰ亾dé卋堺 提交于 2019-12-23 07:22:00
问题 I just noticed that a file called ViewController.swift (Interface) was created automatically by Xcode when I created my first ViewController. Do classes in Swift have/need interfaces the same as in Objective-C and are created behind the scenes by Xcode? Can someone be so kind and explain what is the purpose of this file? ViewController.swift (Interface) import UIKit internal class ViewController : UIViewController { override internal func viewDidLoad() override internal func

Warning: Attempt to present <GuessMeFinal> on <GuessMeFinal.ViewController> whose view is not in the window hierarchy -Swift

巧了我就是萌 提交于 2019-12-23 06:13:55
问题 Okay..here's the problem. When I click the [Play] button in the main menu, it should go to the corresponding ViewController according to this code: @IBAction func playButton(sender: AnyObject) { if rightCounter <= 4 { if let Level1 = self.storyboard!.instantiateViewControllerWithIdentifier("Level1") as? Level1 { self.presentViewController(Level1, animated: true, completion: nil) } } if rightCounter >= 5 && rightCounter <= 9 { if let Level2 = self.storyboard!

NSInternalInconsistencyException - Could not load NIB in bundle

谁都会走 提交于 2019-12-23 05:48:26
问题 I am getting following exception: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/57C8544B-05F6-445D-80A9-FAC9672F278B/MyApp.app> (loaded)' with name 'MyNibName'' I tried number of solutions suggested in stackoverflow's similar questions, but still getting this issue. This issue is with particular xib file which loads address book. This occurs only on iPhone and not on iPad and simulator.

what is the safest way to redefine the target-action method so `UIButtons` relay messages to methods in my `UIViewController`?

自作多情 提交于 2019-12-23 05:42:06
问题 I’m reorganising old code by creating a custom UIView to separate UI elements that belong in the View from those that belong in the ViewController. Several buttons previously included in several ViewControllers are now in a single custom UIView and I need them to send messages to methods inside the current viewController so users can navigate to other viewControllers. This answer on SO suggests using a delegate while this answer to the same question suggests not using a delegate. This answer

what is the safest way to redefine the target-action method so `UIButtons` relay messages to methods in my `UIViewController`?

被刻印的时光 ゝ 提交于 2019-12-23 05:41:04
问题 I’m reorganising old code by creating a custom UIView to separate UI elements that belong in the View from those that belong in the ViewController. Several buttons previously included in several ViewControllers are now in a single custom UIView and I need them to send messages to methods inside the current viewController so users can navigate to other viewControllers. This answer on SO suggests using a delegate while this answer to the same question suggests not using a delegate. This answer

Are there any open source products that will let me share like in Instagram in my iPhone app?

时光毁灭记忆、已成空白 提交于 2019-12-23 05:32:43
问题 I've noticed that apps like instagram and picplz have a fairly standard screen that lets users share their photo on facebook, twitter, flickr, posterous, etc. Does anyone here know if there's an open source product that I can put into my iPhone app that will let me do the same thing? Specifically it would be great if there some subclass of UIViewController that had all those share options in one place. Thanks for your help! 回答1: I think you look for something like ShareKit. I didn't use it

My iPhone app crashes after opening it from background and selecting Tab atIndex:0

孤者浪人 提交于 2019-12-23 05:32:10
问题 I really can't figure this out. When I click a link to open Safari from within my app, browse through the webpage, then return to my app, I can open and browse two tabBarItems in my UITabBar . But, when I try to select the one atIndex: 0 , I get an EXEC_BAD_ACCESS and the following :(. Can anyone help me figure out how to make this not happen? I currently don't have any code that executes in will or didEnterBackground or Foreground . None. So the problem must be in the UIViewController for

My iPhone app crashes after opening it from background and selecting Tab atIndex:0

穿精又带淫゛_ 提交于 2019-12-23 05:32:08
问题 I really can't figure this out. When I click a link to open Safari from within my app, browse through the webpage, then return to my app, I can open and browse two tabBarItems in my UITabBar . But, when I try to select the one atIndex: 0 , I get an EXEC_BAD_ACCESS and the following :(. Can anyone help me figure out how to make this not happen? I currently don't have any code that executes in will or didEnterBackground or Foreground . None. So the problem must be in the UIViewController for