xib

How to disable Xcode 5 automatically upgrade xibs to iOS7 appearance

二次信任 提交于 2019-12-02 20:57:51
If you open an Xcode 4.x project at Xcode 5 and then open a xib at Interface Builder, you will get an alert: NOTE: I only have the issues with the forced iOS7 appearance, auto layout is still turned off for me. And then i accidentally clicked "Alway Upgrade" so Xcode automatically upgrades all my xibs to Xcode 5 and iOS7 prior. But i use Xcode 4.x parallel and it's very annoying to switching back all the xibs when i accidentally open them in Xcode 5. Before opened in XCode 5 interface builder: After opened in XCode 5 interface builder: I searched in Xcode and on Google to get the way to turn

Add subview to a xib file

本小妞迷上赌 提交于 2019-12-02 20:04:22
问题 I'm trying to add a label to a UIView in a xib file. When I run the app, the label doesn't shows up. - (void)viewDidLoad { [super viewDidLoad]; self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 50, 200)]; [self.label setText:@"This is a label"]; xibView *myxibView = [[xibView alloc] init]; [myxibView.myView addSubview:self.label]; } 回答1: 1.If your controller has the same name with your xib, For example,XibViewController.m & XibViewController.xib. Your controller will set its view

How to load NSView from Xib with Swift 3

◇◆丶佛笑我妖孽 提交于 2019-12-02 19:08:41
问题 How to load NSView from Xib properly? My code: var topLevelArray: NSArray? = nil let outputValue = AutoreleasingUnsafeMutablePointer<NSArray>(&topLevelArray) if Bundle.main.loadNibNamed("RadioPlayerView", owner: nil, topLevelObjects: outputValue) { let views = outputValue.pointee return views.firstObject as! RadioPlayerView } topLevelArray = nil return nil The problem is "outputValue" is a auto-release pointer, and as soon as I return from the function, the program crash with ACCESS_BAD

Link a button in a XIB to a viewcontroller in a Storboard

拟墨画扇 提交于 2019-12-02 15:21:17
问题 I have a XIB viewcontroller with a button in it. I also have a storboard viewcontroller. I would like to know if there is a way to link a button from the xib view controller to the storyboard viewcontroller. 回答1: Short answer: No, not using interface builder. You can do it in code though. Once you have the two view controllers instantiated just set the relevant property on your storyboard view controller. 来源: https://stackoverflow.com/questions/22738179/link-a-button-in-a-xib-to-a

Xcode: Run project with specified localization

夙愿已清 提交于 2019-12-02 14:56:06
My Cocoa project is localized in Italian (my language) and English language. If I run it, i see everything in Italian (of course, my OS is italian!). How can I run it to test the English localization without changing the OS language? In the old times, Leopard and before, the get info window in Finder would let you choose the available languages. So it was a matter of deselecting the language that you don't want to use and it would "default" to the other. These days you can use an utility like this one . I'd love to know what it does behind the scenes though. I finally found a nice solution in

Show view from bottom with options

旧时模样 提交于 2019-12-02 12:56:38
When I navigate to a certain viewcontroller, I want a view from bottom with options like so... How can I have such a view...? EDIT 1 I have tried to achieve as suggested in the link using a tableview instead of collection view. And this is what I have... And dragging down the view gives me this view... But I come to the view, I don't want the slide up view to cover the entire length of the view, but it should only be of the same size as given in the 1st screenshot. How can I achieve that..? Assuming you are using same github project that I posted in comment. First remove the garbage : File ->

How to load NSView from Xib with Swift 3

半世苍凉 提交于 2019-12-02 11:03:40
How to load NSView from Xib properly? My code: var topLevelArray: NSArray? = nil let outputValue = AutoreleasingUnsafeMutablePointer<NSArray>(&topLevelArray) if Bundle.main.loadNibNamed("RadioPlayerView", owner: nil, topLevelObjects: outputValue) { let views = outputValue.pointee return views.firstObject as! RadioPlayerView } topLevelArray = nil return nil The problem is "outputValue" is a auto-release pointer, and as soon as I return from the function, the program crash with ACCESS_BAD_ADDRESS Adam Waite I made an protocol and extension to do this: import Cocoa protocol NibLoadable { static

Link a button in a XIB to a viewcontroller in a Storboard

流过昼夜 提交于 2019-12-02 10:49:24
I have a XIB viewcontroller with a button in it. I also have a storboard viewcontroller. I would like to know if there is a way to link a button from the xib view controller to the storyboard viewcontroller. Short answer: No, not using interface builder. You can do it in code though. Once you have the two view controllers instantiated just set the relevant property on your storyboard view controller. 来源: https://stackoverflow.com/questions/22738179/link-a-button-in-a-xib-to-a-viewcontroller-in-a-storboard

Working with One Xib with Multiple Classes

冷暖自知 提交于 2019-12-02 10:48:44
I have already asked a question here Handling Multiple Xib or Fixing collapse and expand button on multiple Xib file then I thought to stop using multiple xib and only main xib with different classes but is it possible ?? Can someone guide me in way which is possible for me to do ? Please help me to fix it Code for UIbutton im using - (IBAction)btnPupl:(UIButton *)sender { CGRect rect; sender.selected = !sender.selected; if(sender.selected ){ [sender setImage:[UIImage imageNamed:@"plus_1.png"]forState:UIControlStateNormal]; pView.hidden = true; eomView.hidden = true ; eomLable.hidden = true;

New NSWindow from application - mission impossible?

馋奶兔 提交于 2019-12-02 10:07:00
OK, what am I doing wrong? 1. Created cocoa app and appDelegate named: window2AppDelegate 2. window2AppDelegate.h #import "PrefWindowController.h" @interface window2AppDelegate : NSObject <NSApplicationDelegate> { NSWindow *window; PrefWindowController * ctrl; } @property (assign) IBOutlet NSWindow *window; - (IBAction) buttonClick:(id)sender; - (IBAction) buttonCloseClick:(id)sender; @end 3. in xib editor, window connected to window controller - set to appdelegate, buttonclick actions to buttons 4, created #import <Cocoa/Cocoa.h> @interface PrefWindowController : NSWindowController { @private