Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple nibs in PB/IB?



You can definitely have more than one NIB in Cocoa/Java programs.
I use many, but I never asked IB to parse existing Java files - only subclassed java.lang.Object
and made the file's owner that class.

I then load the extra NIBS by
{
CashbookViewer editor = new CashbookViewer();
this.retain(editor);
NSApplication.loadNibNamed("CashbookNIB", editor); }
where CashbookViewer would be the class (fully qualified) of File's Owner in NIB file.

As an aside, I find that, in the example above, if editor gets Java garbage collected
then a program crash occurs. I am still not sure what the best way around this problem is,
so I just keep a handle to editor around....

What do people do in situations when they are frequently creating/destroying stuff?
For instance, if I close the window in the CashbookNIB its gone and all released on Cocoa
side, but I still have the editor object referenced in my Java program.

Cheers,
Steve

On Thursday, October 31, 2002, at 05:14 AM, Rick Kitts wrote:

Hello. I'm trying to do something that I thought was simple but may not be. Basically
I'm trying to create another nib inside of my project. (Just to be clear, this is a
cocoa-java application). What I'm doing specifically is following an example
for creating an about box in the book "Building Cocoa Applications" which is
an ObjC book.

Anyway, what I do is create a nib directly in IB choosing the empty cocoa
thing. I want the "File's Owner" in the instances panel to be a specific Java
class so that I can wire it up using the control drag stuff. What I'm finding is
that IB won't parse Java files. At least I can't figure out how to do that.

So this leads me to 2 questions:

1 - Can you have more than 1 nib in a Cocoa-Java appl built with PB/IB?

2 - Can you import a Java class into IB when you create the nib from within
IB (and not PB)?

Kinda frustrated,
---Rick
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.


--
"Think Twice , Do Once, Repeat As Necessary"
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Multiple nibs in PB/IB? (From: Rick Kitts <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.