For tutorials, source code, and other info, try:
StepWise
and
Cocoa Dev Central
As for your integer question, try
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier><font color = green>int</font> a;
...
<font color = green>return</font> [NSString stringWithFormat:<font color = orange>@"%d"</font>,a];</font>[/code]
"%d" is the format representation for an integer. See some printf documentation for more information.
You could also try
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier><font color = green>int</font> a;
...
<font color = green>return</font> [[NSValue valueWithInt:a] stringValue];</font>[/code]
which might be cheaper than evaluating a format string.
And for the random number, what exactly are you trying to do? One common trick is to set the seed when you start your program
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>-(<font color = purple>id</font>)init {
<font color = purple>self</font> = [<font color = purple>super</font> init];
srandom(time(<font color = green>NULL</font>));
<font color = green>return</font> <font color = purple>self</font>;
}</font>[/code]
and then later in the program, use some math to get your number. For example, if I want an int between 0 and 10, I'd use
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier><font color = green>int</font> a;
...
a = random()%<font color = blue>10</font>;</font>[/code]
Does that help any?
[ 06-09-2001: Message edited by: starfleetX ]