xib

File's Owner + First Responder

会有一股神秘感。 提交于 2019-12-05 02:24:02
问题 What exactly does the File's Owner and First Responder Placeholder in Xcode represent? 回答1: Files Owner and First Responder are proxies for objects that will exist at runtime. Specifically, Files Owner represents the object which will be passed in for owner in the method [NSBundle loadNibNamed: owner]. You can specify, via the Attributes Info Panel, what kind of object owner will be. Once you've indicated what Files Owner is, you can make connections to it. First Responder is your portal to

Upgrading to Xcode 5.0.2: xib warning. Attribute Unavailable

孤人 提交于 2019-12-05 01:45:18
I recently upgraded to xcode 5.0.2 Now, I'm getting this warning when I build my Cocoa app: Attribute Unavailable Use Current Width For Max Layout Width on Mac OS X version prior to 10.8 I tried to locate 'Max Layout Width' but I wasn't able to. How do I get rid of this warning? In Xcode 5.1, uncheck the "First Runtime Layout Width" checkbox in the NSTextField 's attributes inspector to remove the warning. markhunte's answer should give you the background, but in my case there simply wasn't a checkbox for Use First Layout Width As Max for any of my controls. However, in the .xib one text label

From XIB to Storyboard

流过昼夜 提交于 2019-12-05 01:33:13
问题 I got an app with a storyboard and one window in .xib. From the storyboard to the .xib i move in that way: ShowDreamNIBController *detailViewController = [[ShowDreamNIBController alloc] initWithNibName:nil bundle:nil]; [self presentModalViewController:detailViewController animated:nil]; How can i move back from the .xib to the storyboard? And one more question. Can i send some information when move to the .xib from storyboard? Like i do it throught segues in prepareForSegue method UPD I got

Initializing a view with custom initWithCoder

风流意气都作罢 提交于 2019-12-05 01:30:46
In order to initialize a view that has xib, I use initWithCoder function. But what if I need to initialize the xib with custom parameter. I need something like this: - (id)initWithCoder:(NSCoder *)aDecoder andTitle:(NSString *)titleString { self = [super initWithCoder:aDecoder]; if (self) { self.titleLabel = titleString; } return self; } And when do I call it? After awakeFromNib ? You can't modify the initWithCoder: method like that because the method is defined in a protocol you don't control. Instead you need to either call the setTitle: method after the object has been created, possibly in

iOS: disable UI mirroring in XIB

纵然是瞬间 提交于 2019-12-05 00:45:17
问题 in iOS 6 there's a new "feature" that mirrors the UI elements in the xib file if the user is on right-to-left locale (hebrew, arabic). (http://developer.apple.com/library/ios/#documentation/miscellaneous/conceptual/iphoneostechoverview/iPhoneOSTechnologies/iPhoneOSTechnologies.html) It completely messes up my interface. Is there a way to disable it without disabling auto-layout? 回答1: Horizontal constraints have the "Direction" option in Interface Builder. By default it's set to "Leading to

Transitioning from XIB files to Storyboard

ε祈祈猫儿з 提交于 2019-12-04 23:42:35
I currently have an XCode project that uses XIBs and would like to start using Storyboards. Is there a good way to move my XIB files into the Storyboard? You can do this manually one view controller at a time. Copy the view from xib (⌘ c). Go to storyboard and create a new view controller in it. Then select the view of that view controller and hit paste (⌘ v). 来源: https://stackoverflow.com/questions/7798400/transitioning-from-xib-files-to-storyboard

Why doesn't initWithNibName work for my UIViewController subclass?

我只是一个虾纸丫 提交于 2019-12-04 23:38:33
I have subclassed UIViewController into a new class, PageViewController (I'm writing a simple book app). I want to add a new view loaded from a nib file and am using the following code. It works. PageViewController *viewController1 = [[UIViewController alloc] initWithNibName:@"Page1" bundle:nil]; [viewController1.view setUserInteractionEnabled:YES]; [self.view addSubview:viewController1.view]; However, the first line is wrong because I should be calling alloc on PageViewController. When I correct it (below), the code compiles but the xib file doesn't load and the view is just transparent.

Can I Animate an image iOS8 LaunchScreen.xib

最后都变了- 提交于 2019-12-04 23:26:17
Question: Are there ways to animate anything within the LaunchScreen.xib file of an Xcode 6 Project targeted to deploy for iOS 8.1+ ? Context: I'm looking to make simple animations to convey activity or serve as a distraction to the user while they wait... Examples: A Loading Bar Activity Indicator Animated GIF Move a UIImage across the Screen Rotate an Image Nope. The Launch Image is shown only during the time period between when the user chooses to launch your app and when your app has actually started running. During this period, your app can't take any actions such as performing an

Custom UIView from Xib - requirements, good practices

天大地大妈咪最大 提交于 2019-12-04 21:56:41
I'm trying to wrap my head around the topic of creating custom UIView using Xib files. I've done it many times, but I've never thought about why this process is so complicated , and which parts are necessary, which are good to have etc. And right now, because Xibs are the main component of the project I'm working on, I started questioning everything - I need to be sure what is happening 😉 Assume we've just created a simple UIView subclass - let's call it CustomView , and basic requirements of this class would be to implement to required initializers lik this: class CustomView: UIView { // This

Build xib Interface Builder and load them as subview in iphone

给你一囗甜甜゛ 提交于 2019-12-04 18:24:52
what I would like to know if it's possible to build a view and its correspondent xib file. Then, in a generic controller, load this view programmatically and add as a subview to the current view. This subview should act as a generic info box which can be loaded by many controller. thanks Leonardo Leonardo I found solution myself, after looking at some stackoverflow thread. So I would like to share what I found and see if it's an acceptable solution. Basically this is what I did: create a MyView.m view file with all my required IBOutlet build a MyView.xib view in interface builder, leaving