Storing an int into NSNumber then calling it in a new class
<p>So basically on my ClassA.h I have created a NSNumber called selected. It is also used in @property as well in that .h. Now in ClassA.m I have a table view and when one is selected it goes to another screen. I would like the indexPath.row to save into that NSNumber. (Selected was @synthesized as well in .m)</p>

<p>Where it is being called in ClassA.m is in the didSelectRowAtIndexPath and looks like this.</p>

<pre><code>selected = [NSNumber numberWithInt:indexPath.row];
</code></pre>

<p>In the next view is where I would like to recall this code so that it can load a perticular view by code based on the selection. I import ClassA.h and this is the code I put in for ClassB.m</p>

<pre><code>HowTosViewController *h = [[HowTosViewController alloc] init];

if([h.selected intValue] == 0){
    content.text = @"0";
}
else if ([h.selected intValue] == 1){
    content.text = @"1";
}
</code></pre>

<p>I'm assuming my issue is I didn't store it correctly or it isn't calling it correctly. I would prefer to do this using the global variables so if there is an easier way to do this using them I wouldnt mind. I appreciate any help.</p>

<p>Also as a side note. When I go to release  selected would it cause any problems or be correct if I did it in ClassB? After it loads the screen from using that number it is no longer needed and another one should be assigned if the person goes back and selects another option.</p>

<p>Thanks :)</p>

<p>EDIT: Forgot to mention what it is doing currently. Currently when clicking on any of the Cells in ClassA it opens the screen and displays 0. </p>
