How to access @public instance variable from another class in Objective-C? -
I know that it is possible to define a public public word @with the public keyword, however, Objective-C syntax Does not allow access to other class' variables. @What facilities do I want from public Ivar? Or how can I use other class Ivars?
Objective-C, definitely public from outside the implementation of class as a superset of C Allows to use the frequency variable. Now, the reason for this is that you have heard that is not allowed this is very disappointing. In most cases, if you want to access any frequency variable outside the context of an implementation, then you should use the accessories and the mute (properties).
An object-class is actually a plain-old C string with a ii
field (that is, it creates an object), where public areas are accessible since we Working with examples of classrooms, we are working as an indicator for an object (special structure). In this way, we have the - & gt; You can use public areas by using
.
Here is an example:
@interferson; Induscipling a person: NSBDIDA {@public NSString * badIdea; BOOL should notDoIt; @ Protected NSString * ahThatsBetterThankGod; @PrivateNosting * MittleTenNov and MySubsCarscentTouchMe; }
Now, in some completely different contexts, we may have:
Any human being encasing * What is oh = [ [Any infant encryption alok] initWithDanger: kDangerLevelEpicBraceYourself]; WhatOh-> BadIdea = [@ "I'm a public area. Make sure to keep me or copy!" Copy]; NSLog (@ "Please Write Some Accessories and Mutants !:% @", Oh-> Bad Idea);
I hope your help!
Comments
Post a Comment