nib

View is null in viewDidLoad

旧城冷巷雨未停 提交于 2019-12-02 10:58:00
问题 I created UITabBarController with each tab contain UINavigationController and set rootviewcontroller in this UINavigationController , all of this is done in interface builder. In viewDidLoad I try to get frame size from view, but when I reference view it return null. Have anyone experienced this before. All IBoutlet are properly connected. 回答1: viewDidLoad returning a nil view if the view is connected in your .xib could mean: For programmatic initialisation (custom controllers): You forgot to

iOS Application launch black screen, UINavigationController, Nib, RootViewController

左心房为你撑大大i 提交于 2019-12-02 10:45:07
I've got the following app, whose RootViewController is named TopicsViewController . When I run it, there aren't any errors or breaks but the screen is black . No table, populated or empty, just a black screen. Not sure which of the following is happening: Is there something wrong with my application didFinishLaunchingWithOptions method in relation to a parser initlizing in it? Is it something to do with my nib file for the TopicsViewController ? I can show more code from my TopicsViewController class if needed. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:

View is null in viewDidLoad

前提是你 提交于 2019-12-02 03:36:12
I created UITabBarController with each tab contain UINavigationController and set rootviewcontroller in this UINavigationController , all of this is done in interface builder. In viewDidLoad I try to get frame size from view, but when I reference view it return null. Have anyone experienced this before. All IBoutlet are properly connected. viewDidLoad returning a nil view if the view is connected in your .xib could mean: For programmatic initialisation (custom controllers): You forgot to call initWithNibName:bundle: on the view controller class altogether (you may have called init or something

loadNibName method is too slow - how to make it quicker?

主宰稳场 提交于 2019-12-01 20:18:04
问题 I have a scroll view, which contains about 40-50 objects of different types. The object's types are defined in function of the object's location (for ex. if is the 5th object in the scroll view-> is's Object1, if it is the 11th object in the scroll view -> it's Object2 type etc.). With a for I am verifying each element of an array, and then putting them into the scroll view, with this method: for (int i = 0; i < [myArray count]; i++){ if (i < 10){ NSArray *xib = [[NSBundle mainBundle]

Pros and cons of using XIBs and doing views programmatically

自作多情 提交于 2019-12-01 19:57:07
I want to decide if it is better to use XIBs or to designs my views completely using code. So far I have read that when you design your views on interface builder they are pre-built, so even if they use more memory the user feels everything is faster. People say doing everything using code is harder but I find it to be just as easy, so I want to know if anyone has experienced some real speed gains when using nibs. What have been your experiences, advice, etc? Thanks! You should be able to do both -- there are times when building a view programmatically is better/easier, and times when using a

Pros and cons of using XIBs and doing views programmatically

女生的网名这么多〃 提交于 2019-12-01 19:38:52
问题 I want to decide if it is better to use XIBs or to designs my views completely using code. So far I have read that when you design your views on interface builder they are pre-built, so even if they use more memory the user feels everything is faster. People say doing everything using code is harder but I find it to be just as easy, so I want to know if anyone has experienced some real speed gains when using nibs. What have been your experiences, advice, etc? Thanks! 回答1: You should be able

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

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

Cannot instantiate UIView from nib. “warning: could not load any Objective-C class information”

我只是一个虾纸丫 提交于 2019-12-01 11:52:05
I get "could not load any Objective-C class information. This will significantly reduce the quality of type information available." warning in the console while initializing an instance of this class: @IBDesignable class SystemMessage: UIView{ @IBOutlet weak var lbl_message: UILabel! var view: UIView! override init(frame: CGRect) { super.init(frame: frame) setup() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setup() } func setup(){ view = loadViewFromNib() view.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight] addSubview(view) }

load nibs in cocoa

江枫思渺然 提交于 2019-12-01 11:25:34
How can I load a nib inside of another window? I tried initWithWindowName, if (mmController == NULL) mmController = [[mainMenu alloc] initWithWindowNibName:@"mainMenu"]; [mmController showWindow:self]; but it opens a new window. I also tried loadNibNamed [NSBundle loadNibNamed:@"mainGame" owner:self]; and it succeeded, but when I try to use the same method to get back to the main menu, [NSBundle loadNibNamed:@"mainMenu" owner:self]; it doesn't work. It does nothing at all... Any ideas? I tried initWithWindowName, You mean initWithWindow¹Nib²Name³: , which takes the name (3) of a nib (2)