Re: class/nib to class/nib declaration error
Re: class/nib to class/nib declaration error
- Subject: Re: class/nib to class/nib declaration error
- From: Ondra Cada <email@hidden>
- Date: Sun, 31 Mar 2002 16:50:52 +0200
On Sunday, March 31, 2002, at 04:04 , Mamdouh wrote:
I4m building an app where the main functions are a window and a panel.
These to where in the same nib until i read that it increases the launch
and the runtime speed to split objects in to different nibs (like
Apple/OmniGroup does in the different apps)... So thats what i4m trying
to do, but until now i have only encountered problems!
I guess you need first to grok better the whole NIB idea, and the MVC
paradigm.
When splitting the two up i made a new nib for the panel and made it its
own class (and header).
There was no need for that (it might be desirable in some cases, but I
doubt in this one).
Because i need the panel to control some objects in the window i
#imported the window4s header so i could reference it for use in some
voids and so on it! And did the same in the windows class with the header
file for the panel for the same reason.
That's bad. Your panel should never directly control objects in another
window (and vice versa). That's MVC, and InterfaceBuilder supports it in
the simplest way: you can't connect an outlet or action between different
NIBs ;)
The desired setup is just to have one controller, declared, say, in
Controller.h, and defined in Controller.m. It would control both the
window and the panel. It has to be instantiated at least at the time the
first of those NIBs is loaded: the most convenient way would be to
instantiate it inside it. The latter NIB though would contain this
controller just as the File's Owner, and will be loaded by that, using
self for owner.
But still when i reference my window in my panels class (or vice versa)
the compiler says:
InfoPanel.m:
"`documentWindow' undeclared (first use in this function) (Each
undeclared identifier is reported only once for each function it appears
in.)"
= The compiler does4nt seem to know what i mean when declaring the window
by its (IBOutlet)name. But i can4t see why! As i said i have remembered
to #import the header that declares the window by its name, but still i
get this error! I4m confused and stuck!
You did not send the offending code so I can't say for sure, but it looks
like you don't understand ObjC properly too...
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.