|
From: | Riccardo Mottola |
Subject: | Re: class/subclass ivars |
Date: | Mon, 11 Jan 2016 16:55:22 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 |
Hi, David Chisnall wrote:
If the ivars are declared in the @interface, then they are visible to all subclasses and you will get an error if the names match ones declared in subclasses. If the ivars are declared in the @implementation context, then you will get no error and each class will refer to its own private version. This gets a bit complicated when you refer to the ivars by name in introspection (you’ll likely see confusing things if you tell KVC to directly access ivars, for example).
thanks. This means that essentially (I don't use KVC) I should always get the expected behaviour and in the subclass I will be referring to my own ivar without interefering. Fine. I must look elsewhere for my problems then.
Riccardo
[Prev in Thread] | Current Thread | [Next in Thread] |