nib

In Cocoa, why won't a textfield be shown until after the IBAction is completely executed?

I have an IBAction with some simple code inside: -(IBAction)change:(id)sender { [textfield setHidden:NO]; [self dolengthyaction]; } 'textfield' is an NSTextField in a nib file, and -'dolengthyaction' is a function that takes about a minute to finish executing. My question is: Why isn't the textfield shown until AFTER "dolengt...

Change classes instantiated with loadNibNamed

I am trying to change the class of objects created with a nib with the iPhone SDK. The reason for this is; i dont know until runtime what the class is that i want the nib object to be (though they will have the same UIView based super class), and i dont want to create a different nib for every eventuality - as the .nib will be the same ...

Good reasons why to not use XIB files?

Are there any good reasons why I should not use XIB / NIB files with an highly customized UI and extensive animations and super low memory footprint needs? As a beginner I started with XIB. Then I figured out I couldn't do just about everything in them. It started to get really hard to customize things the way I wanted them to be. So at...

Custom view with nib as subview doesn't seem to be loading

I've created a custom view that loads its content from a nib, like this: /* PricingDataView.h */ #import <UIKit/UIKIt.h> @interface PricingDataView : UIView { UIView *contentView; } @property (nonatomic, retain) IBOutlet UIView *contentView; @end /* PricingDataView.m */ #import "PricingDataView.h" @implementation PricingDataView ...

Display NSWindow as Subview of NSView...

I have an NSWindow that I want to display as part of another window. It has to be an NSWindow; I don't want to change it to an NSView or anything... I just don't because it involves accessing foreign nib files and the such. How should I accomplish this if possible? I was thinking along the lines of grabbing the view of the NSWindow and ...

Is it possible to hide the dock icon programmatically

Is it possible to hide dock icon programmatically on demand. I know one way by which defining property "Application is agent (UIElement)" in plist we make the cocoa app as user agent. But this result in hiding the dock icon permanently. I am looking for a way where i can control visibility of dock icon. Any idea ? ...

Speed up UI loading from NIBs on the iPhone

First up, i realize this application has some design issues and while rewriting a huge chunk of it would probably solve my issues, I'm looking for a way to make things faster right now. Basically I've got viewController = [[MyViewController alloc] initWithNibName:nil bundle:nil]; viewController.view; where MyViewController.xib is a ...

NSBundle loading a NSViewController

Hey all, I'm looking into a project that would upload custom NSBundles that include a NSViewController. In my main program I've got this code to deal with the bundle after it's been loaded... id principalClass = [loadedBundle principalClass]; id instance = [[principalClass alloc] init]; [localLabel setStringValue:[instance name]]; NSVi...

external images needed by nib file

Hi, I have this nib file, with a large number of NSImageViews that use a large number of Images in my application bundle. I'm hoping to change the images displayed though while the application is running. What I want to do is to externalize these images into an application support folder so that when I want to modify them, I don't hav...

iPhone Internationalization. What is the simplest workflow for me?

Hello, I am wising up and getting my internationalization act together. Right off the bat I am a bit swamped by all the docs Apple provides so I was wondering of someone could sketch a workflow for my situation. Before I begin, I browsed some Apple example code and noticed this NIB file - MainWindow.xib - in the Resources folder: ...

How to display a subview loaded from a separate NIB file

I'm developing a Cocoa desktop application that uses a source list in the style of iTunes: different elements in the source list cause the main content area to display different views. The content area is entirely filled with a (vertical) NSSplitView; on the left is an NSOutlineView source list. When the user selects an item on the left...

Puzzled with nib files...

I know nib files are serialized objects and they have owner, outlets to make connections. Using XCode Navigation window template I created application, which in its order created 2 nib files - MainWindow and SecondView. I can't understand how MainWindow is referring to SecondView, there is no connection between those two as far as I can ...

Communicating between classes set up in nib, in code?

A beginner's question: If, in your nib, you have the File's Owner linked to the ViewController class, and you also have a NSObject-derived class, how do you communicate between the ViewController class and the NSObject class within code? For instance, suppose ScientificCalculatorView.xib looks like this File's Owner (class: Scientifi...

[NSCustomView isOpaque]: message sent to deallocated instance 0x123456

Hi all I receive that message in debugger console since I added the following arguments for debugging my application with XCode. NSZombieEnabled: YES NSZombieLevel: 16 I was looking for zombie objects... Before doing so, the application failed before I could know where what and why was happening.... Now I´m pretty sure that 'something...

How does loadNibNamed?

In most of the samples the return value from loadNibNamed value is not used, so I guess it's using the owner argument. But how does it work and make the connection to the owner object? What kind of requirements should my owner class meet in order to load a nib in such way? The only requirements I can guess is that the owner class mus...

Loading a table view nib after button push

Dear All, I have used the following code to add a button to my navigation bar that when pressed will call the method showCountries: UIBarButtonItem *countriesButton = [[UIBarButtonItem alloc] initWithTitle:@"Countries" style: UIButtonTypeRoundedRect target:self action:@selector(showCountries:)]; self.navigationItem.leftBarButtonIte...

Making sure that objects in nibs are initialized before applicationDidFinishLaunching

Hello, and thanks for taking a look at my problem. i have two view controllers in my app and each has its own nib file. an instance of controller1 is stored in MainWindow.xib and an instance of controller 2 is in Controller1.xib. is there a way to make sure that controller 2 is initialized before the app delegate is sent applicationD...

Window from nib in dylib

Hi, I'm quite new to the Mac but reasonably expirienced with windows. What I need is a window owned opened and closed by the library (dylib). This is very easy to do in MS Windows but seemsnto be hard under Cocoa. I used the code from apple's 'CocoaInCarbon' example with C++ Wrappers. But the 'NSApplicationLoad()' followed by 'NSBundle...

Releasing IBOutlets in UIViewController’s viewDidUnload?

I’m a bit confused as to what happens exactly in Nib-based UIViewControllers. When generating a UIViewController subclass, the template contains a very specific comment in the viewDidUnload method: // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; To which subviews does this apply? The ones I initialize...

Cocoa - Loaded nib file disappears when focus is lost

I have a nib file I've loaded like so [NSBundle loadNibNamed: @"myNibFile" owner: self ] and it pops up fine, but when it loses focus, it simply disappears. I've checked to see if it's vanishing behind my main window but it's not. My app is pretty big so I'm not sure what could be causing it. I have garbage collection enabled if that mak...