xib

New NSWindow from application - mission impossible?

对着背影说爱祢 提交于 2019-12-04 05:40:33
问题 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

Packaging a Bundle with a static library

强颜欢笑 提交于 2019-12-04 03:15:30
I have a static library that includes some xibs. These will basically be the same across projects. I'd like to include the xibs as part of the library. I can include their veiwcontrollers, reference these controllers in the calling project but then there isn't a xib to load. When I right click the xib in the library project, it can't be part of the target. I thought about creating a CFPluginBundle but that creates a new project. I'd loose all of my IBOutlet and IBAction references. What is the best way to reuse xibs that also have outlets and actions to specific controllers? Ricardo Valeriano

How to convert a project using XIBs to Storyboard?

假如想象 提交于 2019-12-04 02:33:13
I have some complex XIB files in a project using TabBarViewControllers containing navigation controllers. Since Xcode 4.2 I cannot edit those XIB files usefully anymore: the contained view controllers are invisible, only represented as grey boxes. It seems that in Storyboard projects this is the default, and the next layer in the storyboard shows the details of the contained views / view controllers. So how can I switch my project to use a storyboard instead? The objects are grayed out because of autolayout. Xcode understands that your controllers are not belonging to the current autolayout

iOS 10 Launch Screen Bug

最后都变了- 提交于 2019-12-03 23:49:29
问题 My Device and Simulator seem to be caching the launch screen for my app! I have deleted the original Launch Screen.storyboard and created my own XIB and swift files called "StartingPointView.xib" and "StartingPointView.Swift". The XIB file contains a view with Blue background color. It is also linked in the Xcode project settings under app icon and launch images. So far everything seems fine, but when I change the color of the StartingPointView's view to say Yellow, the app continues to

Instantiate view from nib throws error

北城余情 提交于 2019-12-03 22:39:37
I tried to make @IBDesignable UIView subclass following this ( link ) tutorial. First custom view goes fine. But when I try to make another one, I have errors. First I got failed to update auto layout status: the agent crashed and Failed to render instance of ... . Somehow I started to be able to biuld and run project with these errors, but then I get new error - EXC_BAD_ACCESS ... on line let view = nib.instantiateWithOwner(self, options: nil)[0] as! UIView . Here is whole method: func loadViewFromNib() -> UIView { let bundle = NSBundle(forClass: self.dynamicType) let nib = UINib(nibName:

Move all subviews to container view keeping positions and constraints

喜欢而已 提交于 2019-12-03 22:17:48
I'm using Xcode 5 and autolayout in my project. I have a .xib file with a lot of subviews and constraints between them. Now I need to create an intermediate fullscreen container view and put all subviews there. So now I have view->subviews , and I want view->container view->subviews . When I do this in IB by dragging subviews into container view, they all get centred and all constraints get lost. It's going to be a little hard to restore all constraints manually. Is there a smart way to do this keeping all subviews' positions and constraints? Add your container view to the hierarchy (to get an

File's Owner + First Responder

若如初见. 提交于 2019-12-03 20:43:55
What exactly does the File's Owner and First Responder Placeholder in Xcode represent? 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 the Responder Chain. You can add Actions to First Responder in the "Classes" tab of the document window. Next

Name conventions for xibs

大城市里の小女人 提交于 2019-12-03 17:45:40
问题 I've been looking at the sample code and sometimes Apple names xib files ClassNameView and sometimes ClassNameViewController . The ClassName is always a UIViewController or UITableViewController , which had me wonder what convention to use when naming a xib. I would think View as it's not really the ViewController , but curious on what the convention is or at least what your naming conventions are for xibs. 回答1: I use ClassNameView since the xib represents the view, not the view controller. I

From XIB to Storyboard

£可爱£侵袭症+ 提交于 2019-12-03 16:28:55
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 answer about closing .xib. Need answer about sending information. you can get back to your storyboard by

Cocoa - Display xib on another xib

跟風遠走 提交于 2019-12-03 16:13:06
Can anyone tell me how (or direct me to info on) displaying a .xib (nib) on another .xib (nib). How ever I wish to place it so I can programically move it around the main nib sort of like this (which obviously doesn't work) - (void)drawRect:(NSRect)dirtyRect { NSRect customView = NSMakeRect(pos1, pos1, 200, 100); [[NSBundle mainBundle] loadNibNamed:@"secondXib" owner:self]; NSRectFill (customView); } And I wish to do this for Mac OS X (Not iPhone). (By the way using xCode 4 incase it makes a difference) You can easily load a view from another nib using NSViewController . In your nib you should