RE: Variables of super classes
RE: Variables of super classes
- Subject: RE: Variables of super classes
- From: "Adam Thayer" <email@hidden>
- Date: Thu, 2 Jun 2005 11:59:38 -0700
You can access members of parent classes from children classes, as the child
will inherit all the data members of a parent. However, a more 'clean' (and
slower, performance-wise) way to do it is provide an accessor method in the
parent class you can call from the child class. This way, if the internals
are changed in the parent class, the child class will not break as long as
that method behaves the same way. On the other hand, if you don't have to
worry about that, then you can simply access the member from the child
class.
This may be a bit extra, and you may already know it, but the outlet will
not be properly initialized for class B unless class B is what is in the NIB
to be used.
-----Original Message-----
From: cocoa-dev-bounces+krevnik=email@hidden
[mailto:cocoa-dev-bounces+krevnik=email@hidden] On Behalf Of
Sanri Parov
Sent: Thursday, June 02, 2005 11:29 AM
To: email@hidden
Subject: Variables of super classes
Hi everybody,
Just a simple question.
I have a class A, instantiated into InterfaceBuilder, which has an
outlet ("g_lock") connected to a textfield.
I have a second class, B, which is son of A
I just want to use g_lock methods from inside B.m (e.g. [g_lock
setEnabled:YES];)
How can I do this?
Thanx for all the answers
--
Sanri Parov
_______________________________________________
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
_______________________________________________
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