Note that there are some explanatory texts on larger screens.

plurals
  1. POXcode - green variables x black variables
    text
    copied!<p>I have two classes. One was basically created using the same files as the second, with some other modifications, but they are essentially the same, specially regarding to their declaration files (that have something like this)...</p> <pre><code>@protocol myClassDelegate &lt;NSObject&gt; // delegate protocol definition @end @interface myClass : UIView { id myObject; UIView *oneView; } @property(nonatomic,assign) id&lt;myClassDelegate&gt; delegate; @property(nonatomic,retain) UIView *oneView; </code></pre> <p>and then I have @synthesize oneView, delegate; on .m</p> <p>The code you see is common to both classes.</p> <p>Inside the implementation of both classes, I use several times both objects, for example:</p> <pre><code>[delegate doStuff]; // &lt;-- do you see this blue delegate here? Xcode put it green when it is declared on .h first. </code></pre> <p>on my first class, every occurrence of oneView or delegate are shown in green by Xcode (see image below). On the second class, they are shown in black. I generally consider this green word to be some kind of acknowledge that the variable has been identified on the declaration and is "global" for that class. Generally black variables mean local instances.</p> <p>The question is that I am having problems of one of these variables being deallocated, without my intention, exactly on the class where it is shown in black.</p> <p>There's no release of that variable in the class (except on the dealloc), but objects created using both classes live all the time while the app is running.</p> <p>What may be wrong?</p> <p><img src="https://i.stack.imgur.com/SBXlq.png" alt="exampla of what I consider correct"></p> <p>thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload