xib

Showing a different XIB/NIB in an iOS app

落花浮王杯 提交于 2019-12-01 14:19:41
I have multiple nib (xib) files and I want the user to see a different one when they tap a button. What I am looking for: - (IBAction)buttonTap { //Code for showing a different nib goes here } I can't figure out how to do this. I can show a different view within the nib file just fine, but I can't get it to show a different nib. How do I show a different nib when the user taps a button? Any help is appreciated! Thanks! The way I handle switching between actual xib's, and I'm sure there are a multitude of ways to accomplish the same thing, is to have my App Delegate act as a routing center

Xcode shows old, deleted xib files

一曲冷凌霜 提交于 2019-12-01 13:53:59
问题 I've searched all over and haven't found any help... I built a small test app with two UIViewControllers and their corresponding xibs. Things were fine, then I made some changes to both xibs but when I build and run, I get the old views. I've tried deleting the build folders, running in the simulator and device, cleaning all targets and still the same, old, broke-down xibs that I totally changed are still showing up. I've restarted all the Xcode apps and even my computer. Getting pretty

Showing a different XIB/NIB in an iOS app

半腔热情 提交于 2019-12-01 12:08:01
问题 I have multiple nib (xib) files and I want the user to see a different one when they tap a button. What I am looking for: - (IBAction)buttonTap { //Code for showing a different nib goes here } I can't figure out how to do this. I can show a different view within the nib file just fine, but I can't get it to show a different nib. How do I show a different nib when the user taps a button? Any help is appreciated! Thanks! 回答1: The way I handle switching between actual xib's, and I'm sure there

starting ios project without storyboard

人盡茶涼 提交于 2019-12-01 08:38:07
Im having some troubles to start an iOS app using xibs instead of storyboard. The problem is that im getting a black screen and the first view controller is not being called (added break point to viewDidLoad method). In the app delegate header i have declared this: @property (strong, nonatomic) UIWindow window; @property (strong, nonatomic) ViewController *viewController; And in the didFinishLaunchingWithOptions method i have this implementation: self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; UINavigationController *navController = [

starting ios project without storyboard

时光怂恿深爱的人放手 提交于 2019-12-01 06:36:35
问题 Im having some troubles to start an iOS app using xibs instead of storyboard. The problem is that im getting a black screen and the first view controller is not being called (added break point to viewDidLoad method). In the app delegate header i have declared this: @property (strong, nonatomic) UIWindow window; @property (strong, nonatomic) ViewController *viewController; And in the didFinishLaunchingWithOptions method i have this implementation: self.viewController = [[ViewController alloc]

Subclassing a subclassed UIViewController that has a xib

♀尐吖头ヾ 提交于 2019-12-01 04:01:53
I need to have a few UIViewControllers that look very similar yet have different behaviours, so I thought I'd make a general UIViewController subclass with a xib, then subclass it when I need to, for those different UIViewController's that look alike. I'm trying to achieve the following UIViewController subclass (that has a xib file associated) -> and being able to subclass it as many times as i'd like (without additional xib files for the children) what I've done so far : xib file represents a UIViewController with multiple UI Elements. I've set all the connections to file's owner @ xib file.

UITableViewCell throwing exception

时光怂恿深爱的人放手 提交于 2019-12-01 03:22:47
I am updating a project to iOS 8 and am running into this issue with one of my UITableViewCell implementations. Currently on Simulator and not a device and it is set to "iPhone 6". *** Assertion failure in -[UITableViewCell _setHostsLayoutEngine:], /SourceCache/UIKit_Sim/UIKit-3318/NSLayoutConstraint_UIKitAdditions.m:2754 2014-09-15 10:43:52.890 BasketballStatTracker[10662:304085] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES.' The odd part is that I am using this

Xcode “-[UIViewController _loadViewFromNibNamed:bundle:] loaded the nib but the view outlet was not set.” error

感情迁移 提交于 2019-12-01 03:22:37
I'm using Xcode 4 and when I run my app, the first screen doesn't load. It fails in the simulators and on a device. I've searched for answers and they all say to make sure I've dragged the circles in Files Owner to the correct views. Sorry I don't remember the names of the things, I'm new to Xcode. I've dragged the circles to the correct view and tried many things but none of them worked. What could I be doing wrong? Here is the full error: 2012-02-19 12:59:54.655 Ponyboard[271:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController

Swift - Assign a NIB to self in class

心已入冬 提交于 2019-11-30 23:15:01
I am creating a UIView subclass for a notification dropdown banner. I am using a XIB to build out the view and want to assign that xib to the class when it initializes (i.e. avoiding having to do this from the calling ViewController). Since you can't assign to 'self' in swift, how do I properly do this from within the class itself? class MyDropDown: UIView { func showNotification() { self = UINib(nibName: nibNamed, bundle: bundle).instantiateWithOwner(nil, options: nil)[0] as? UIView } } For anyone looking on how to initialize a xib from it's own class in swift, here is the best approach using

Integrating a SpriteKit view into a xib view

强颜欢笑 提交于 2019-11-30 21:24:20
I have a view that I already created using a xib file. Now I would like to add some small elements to this view that would make use some of the physics animations from SpriteKit, so now I need an SKView. Is it possible to add an SKView as a Subview of the view that corresponds to my xib view? I tried this and it does not seem to show anything. The following is in the ViewController corresponding to my XIB view: this.myCustomSKView = new CustomSKView() this.View.AddSubview( this.myCustomSKView ); and the ViewController for my custom SKView has: public override void ViewWillLayoutSubviews () {