Variables: Why one way and not another?
Variables: Why one way and not another?
- Subject: Variables: Why one way and not another?
- From: Robert Borsuk <email@hidden>
- Date: Sat, 1 Nov 2003 09:35:17 -0500
Hi All,
I've been combing the archives and I've found some interesting answers
but nothing that nails it down for me. Maybe someone can explain. So
I've been working with Cocoa / Obj. C for a couple of months now. I
make my Controller by the usual subclass of NSObject, put variables in
the there and every thing is fine.
Like so:
@interface MyController : NSObject
{
int myInt;
}
I write some accessors and life is good. Now I put an NSView on a
window and subclass it. I try the same thing and no go. I notice that
:
@interface myview : NSView
{
int myInt;
}
Doesn't work. I can move the variable out of the instance declaration
area, like such:
int myInt;
@interface myview : NSView
{
}
and life is good. Why the difference? I put the View in the window
using IB and assign the subclass there. Doesn't the instance remain
through the life of the program or am I missing something? Any
clarification will help.
Thanks
Rob
Rob Borsuk
email: email@hidden
Colourfull Creations
Web:
http://www.colourfull.com
_______________________________________________
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.