nib

Accessing nib/xib objects from controller.

Hi! I have a UI file in xcode, and I have an AppDelegate class with an awakeFromNib function. From this function, is there a way to change properties of objects which are in the UI? For example, change the string of a label, textfield and so on. Sorry for bad english, tried to explain as well as I could. Any help would be very apprec...

NSArrayController initialization

I am having trouble getting an core-data backed NSArrayController to work properly in my code. Below is my code: pageArrayController = [[NSArrayController alloc] initWithContent:nil]; [pageArrayController setManagedObjectContext:[self managedObjectContext]]; [pageArrayController setEntityName:@"Page"]; [pageArrayController s...

Decomposing an iPhone user interface -- multiple views in one xib?

I have one main view with an associated controller. I have some rather complicated toolbars that I need to switch in and out depending on user interaction. To keep things simple I manage the toolbars with my main view controller, rather than having all sorts of intertwined dependencies or really deep delegate chains. Anyway, how can I ...

calling initWithNibName doesn't initialize items in the nib, it has 0x0.

When I call: self.viewController = [[DidItViewController alloc] initWithNibName:@"DidItViewController" bundle:nil]; and then I check self.viewController.navController right after this line is executed in the debugger, I find that it's empty (0x0). On DidItViewController I have my navController defined as: IBOutlet NavigationControll...

How to convert nib/xib to objective C code?

I am just wondering is there a way to convert nib/xib file to ojbective C code? I just want to find the equivalent code to the nib/xib file (I've tried nib2objc, seems the result is not what I am after). Actually I want to compile this example http://developer.apple.com/iphone/library/samplecode/TableSearch/index.html without nib/xib ...

Are there alternatives to ibtool for parsing NIB files?

As part of an i18n project, I need to extract strings from a NIB file programmatically. This can be done quite easily with ibtool, of course. But this is a cross-platform product, of which the NIB is only part. It would be nice if we didn't have to lock string extraction to a particular machine, or have to kludge together catalog-merg...

What design pattern best represents the "File Owner" object in the iPhone?

I'm new to iPhone development. I'm reading that the "File Owner" in the xib is the responsible for instantiating all objects defined in the nib... some type of factory pattern comes to mind, but maybe I'm not looking at the big picture... So, what would be the closest design pattern (gof) associated with the "File Owner" concept? ...

Can you swap the NIB file for a UIViewController that's already on-screen?

For instance: Create a new UIVC using initWithNibName, using "nib-v1" Display it, e.g. using [(UINavigationController) nav pushViewController: myVC] Change the NIB that myVC is using to "nib-v2" So far as I can see, this is the "correct" approach to app-design for a lot of apps, when paging through information where you need two slig...

How Do I (Re)Use the Same Nib in Multiple View Controllers

Okay I just typed this whole question out and then managed to delete it. Sigh. Anyway, standard disclosure that I have searched everywhere and banged my head on the keyboard and can't figure this out. I'm building a basic app based on the utility application template (with a MainViewController and FlipsideViewController). Side note: I s...

Make Xcode skip nib compilation

Hi, I'm creating an application which must be 'hacker compatible', so that people can edit nibs and stuff. However, when I show package contents, the nibs are compiled so I can't open them in IB. Is there a way I can make Xcode don't compile the nibs? Thanks ...

How Can I Create a Nib with an asociated View Class that can be used by Multiple ViewControllers

I'm opening a new question to followup on my last one (http://stackoverflow.com/questions/2064513/superview-and-parentviewcontroller-nil-after-adding-a-subview). Basically I get that using subviews is a good idea, but that I shouldn't have a ViewController controlling a subview that lives inside another ViewController. Basically I'd like...

How does NSViewController avoid bindings memory leak? [have sample app]

I'm trying to implement my own version of NSViewController (for backwards compatibility), and I've hit a problem with bindings: Since bindings retain their target, I have a retain circle whenever I bind through File's owner. So I thought I'd just explicitly remove my view from its superview and release the top level objects, and that wo...

Retain counts of IBOutlets

While coding always the same questions concerning retain counts of IBOutlets came along: Retain count after unarchiving an object from NIB? When to use @property's for an IBOutlet? Retain or assign while setting? Differences between Mac and iPhone? So I read The Nib Object Life Cycle from Apple's documentation. Some test apps on Mac and...

Is there anything like viewDidLoad for the loading of the app's main xib?

As in the one defined with "Main nib file base name" in the app's Info.plist. Should I just use applicationDidFinishLaunching? ...

What's the correct way to perform initialization code whether an object is loaded from a nib or created programmatically?

I've noticed that if you load connected views from a nib you have to override initWithCoder if you want to add initialization code because the designated initializer doesn't get called (which does make sense), and if you don't load the view from a nib then the same code needs to be executed in the designated initializer. So in order to ...

Cocoa: what is the var name of an instance created by a NIB file?

When a Cocoa NIB file instantiates an instance of a custom controller object, what is the name of the variable that that custom controller instance is assigned to? In case that isn't clear, if you manually created an instance of that class you would do: MyControllerClass *myVar = [[MyControllerClass alloc] init]; What equivalent of "...

Cocoa: what creates the instance of a controller class linked to a NIB file?

This is a question about the inner workings of Cocoa NIB files and the supporting framework classes for them. For a handy example, please take a look at the Apple Currency Calculator tutorial: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjCTutorial/01Introduction/01Introduction.html If you open the MainMenu.n...

How Does IB Load a UIImage: imagedNamed vs imageWithData?

After reading the memory management for UIImage, I'm worried about how interface builder loads an UIImage. Does it use UIImage:imagedNamed or UIImage:imageWithData? ...

How I do to call a nib file at only first launch of my application?

Hi all, I'm new here but I'd like to learn very well iPhone SDK... I'm making an iPhone app where I'd like to show a modalView controller at launch of my app... How can I do this? In this modalView, I request some informations and the view must appear only when these informations aren't saved! Anyone can help me? P.S.: Sorry for my bad ...

How can I view an XIB from an app store app?

I downloaded an app with nice design and unpacked it's contents. I'd like to look at the NIBs to see how the app is put together. I renamed the NIBs to XIB, but Interface Builder won't open them ("Interface Builder was unable to determine the type of PageView.xib"). Is there any way to force it to open the file. Would I be able to see an...