xib

Pass Data from TableViewController to XIB file Without Segues- Swift 3

不羁岁月 提交于 2019-12-12 02:09:25
问题 Im new to swift and learning swift 3 Im trying to pass data from table view controller to XIB file . I have list of fruits in my table view controller. On click of that i would like to display fruit name in a label in new XIB controller. I tried below code but it is not showing me any data in XIB vc..please tell me what am I missing here My TableVC: class FruitsTableViewController: UITableViewController { var fruits = ["Apple", "Apricot", "Banana", "Blueberry", "Cantaloupe", "Cherry",

How to call performSegueWithIdentifier from xib?

家住魔仙堡 提交于 2019-12-12 01:28:48
问题 I have viewController with segue to secondViewController named "toSecond". In viewController i load customView.xib let myCustomView = NSBundle.mainBundle().loadNibNamed("customView", owner: self, options: nil)[0] in this customView i have button with action: viewController().goToSecond() in viewController i have function with this code func goToSecond() { self.performSegueWithIdentifier("toSecond", sender: self) } but when i pressed button in customView i become a error: viewController has no

Manipulate IB Outlets in awakeFromNib for UICollectionViewCell even if not using custom XIB?

ぃ、小莉子 提交于 2019-12-12 00:35:18
问题 The code below is used to manipulate and configure IB Outlets of a subclassed UICollectionViewCell. The IB outlets in the class, however, are not yet connected at this stage. Other SO posts like this one suggest using awakeFromNib to manipulate the IB outlets, but in all the answers, the problem deals with a custom XIB. However, this subclass doesn't use a custom XIB. Is it still right to use awakeFromNib to configure the IB outlets even if no custom XIB is used? override init(frame: CGRect)

Load NIB from variable

こ雲淡風輕ζ 提交于 2019-12-11 23:48:44
问题 I'm trying to load a NIB based on a variable I get from my settings file. This is the code: //select the right nib name NSString *nibVar = [nibs objectForKey:@"controller"]; // create the view controller from the selected nib name UIViewController *aController = [[UIViewController alloc] initWithNibName:nibVar bundle:nil]; aController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:aController animated:YES]; [aController release]; This

[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (IBCIImage)

徘徊边缘 提交于 2019-12-11 23:26:57
问题 After changing location of some UI elements( NSButton ) in xib ( Xcode 5 ). I am getting following exception on console (10.6 and above) but view is loaded properly. -[NSCoder(CACoderAdditions) CA_decodeObjectForKey:]: ignoring exception *** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (IBCIImage) and crash on OSX 10.5 Application Specific Information: *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -

How to create custom slide menu without third party library.?

孤者浪人 提交于 2019-12-11 20:01:58
问题 I want to implement slide menu in my iOS app like drawer (Andriod). I went through a tutorial, but all of them are using third party libraries. Is there any possibility to create a custom slide menu. I tried to create it with the following code, but it's only working with xib file: - (IBAction)sidemenu:(id)sender { [UIView animateWithDuration:0.50f animations:^{ view.frame = self.view.frame; } completion:^(BOOL finished) { swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self

simple app with error “ this class is not key value coding-compliant for the key ”

泄露秘密 提交于 2019-12-11 19:26:21
问题 I create a simple iPhone app with xib file, and add one button to the view. create a IBOutlet to connect with it. each time, I launch it, it will crash. the full error message is as below: 2014-05-03 08:10:19.742 test[1435:a0b] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key txtBtn.' There are many people hitting this question, After reviewing the answers, I think my problem is

Making a popover segue´s View Controller stay persistent (only allocate one instance)

与世无争的帅哥 提交于 2019-12-11 19:25:18
问题 I programmed my app initially for iPhone using a tab bar controller were the view controllers are initialized once and stays persistent - it does not initialize a new instance of the view controller when I tap the tab bar. on the iPad I am using a different GUI were instead I have one main view that always stays on the screen, and the rest are popovers segueing from the main view. I want the popovers to stay persistent (only initialize once) what is the best way of archiving this. If I had

Why is my popup view is empty?

烈酒焚心 提交于 2019-12-11 18:41:32
问题 I am trying to make a popup view similar to this one. What I have done so far is: Open a new single view project. Added a button to the main view. Added a new xib file named "popup.xib" Added a new swift file named "PopupViewController.swift" At the identity tab I made the first responders class to be "PopupViewController" I put in the popup.xib a label, a button and a view with different background colour. Of course everything has constraints about where it should appear. My code:

Adding iPad XIB to a View Based Application Template Application in XCode 4

微笑、不失礼 提交于 2019-12-11 17:52:26
问题 I've created a View Based Application in XCode4 ; when creating the application I selected iPhone as the Device Family : The application was created with the following files: I designed the UI on the TestushViewController.xib file and without adding any code in the Delegate files, the application is uploading immediately to the TestushViewController.xib view and I'm very happy about it. Now I want to add an iPad xib . How do I do that? (I knew how to do it in XCode 3, but I used some code in