Partial Solution: Displaying a new NIB fails; but a duplicate of an existing/working NIB does display.
Partial Solution: Displaying a new NIB fails; but a duplicate of an existing/working NIB does display.
- Subject: Partial Solution: Displaying a new NIB fails; but a duplicate of an existing/working NIB does display.
- From: "Frederick C. Lee" <email@hidden>
- Date: Sun, 30 Oct 2005 21:02:26 -0800
- Resent-date: Mon, 31 Oct 2005 11:46:28 -0800
- Resent-from: "Frederick C. Lee" <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: Cocoa Developers <email@hidden>
Scenario:
Essentially I just want to programmatically load an additional NIB
and display/process its window. The NIB is owned by a customized
NSWindowController.
The logic is straight forward, using variants of NIBs called 'Smirf'.
- (IBAction)loadSmirf:(id)sender {
myWindowController = [[MyWindowController alloc]
initWithWindowNibName:@"Smirf3"];
if ([myWindowController window])
[[myWindowController window] makeKeyAndOrderFront:nil];
else
NSLog(@"{loadSmirf} Sorry, No Window.");
NSLog(@"{loadSmirf}");
}
I've traced the problem to the actual NIB that was built; more
precisely, its subNIBs {classes, info and keyobjects}. Copying the
subNIBs from a successfully-loaded NIB into a problem NIB ("Smirf")
"cures" the symptom. So the source of my problem is actually the
GENERATING of the correct NIB via the correct NIB template.
There are three models (amongst others):
1) Empty NIB -- which I had used and got this problem;
2) Window NIB - which apparently doesn't work here; and
3) Application NIB - which **works**.
Being a neophyte here, I'll work with the Application-template NIB.
It appears to be the chosen template to work with NSWindowControllers.
Any advice or suggestion as to when/how to use the Empty/Window NIB
(and avoid this non-loading hassle); or any reference sources would
be appreciated.
In the meantime, I'll just work with the Application-NIB template and
modify it accordingly. I don't know how/where to use the other
templates.
Regards,
Ric.
Greetings:
I'm working with the CoreRecipes Binding/Core Data {Chef, Recipes,
Ingredients entities} example.
I'm trying to create a *new* NIB to access the core data, but
cannot display the NIB's window; however, loading a duplicate of an
existing NIB works.
Problem: I can't load a window; that is, [windowController window]
== nil.
Test Scenaro:
1) I made duplicate NIB of RecipeEditorWindow.nib called
'Smirf.nib' and changed the load code accordingly and re-ran the code.
-- Loads okay.
2) I *created* a NEW NIB ('Cocoa Empty' type) called
'Smirf.nib' (replacing the old Smirf) with the bare essentials of
having only a NSWindow; re-ran the code. --- FAILS to Load.
3) I'm using the SAME customized Window Controller in both
scenarios. Only the NIBs are different (one is new, the other is a
duplicate of a working NIB).
Hence: a duplicate of a working NIB *works*; but a NEW NIB with the
same name *fails*.
Analysis:
1) Each NIBs contains the following 'sub-nibs': a) class, b) info,
and c) keyedobjects; as seen via XCode under 'English'.
2) I copied these sub-nibs from the working NIB into the
*malfunctioned* NIB (the NIB that was created, not duplicated).
--- It Works! The new NIB with the copied sub-NIBS (class,
info & keyedobjects) does get loaded.
===============
Question: What am I missing within the program source code that
prevents me from creating a viable new NIB (with the correct
keyedobjects, etc.)?
Regards,
Ric.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden