Thanks for the reply. Does the same logic work with NSArray? Meaning
that if you use [NSArray arrayWithObjects: @"Triangle", @"Square",
@"Pentagon", @"Hexagon", nil], you don't need to release it since it's
made up of constants?
I did the autorelease routine on such an array, but when I executed
it, the program just seemed to go on an infinite loop. I haven't
gotten as far as using gdb, yet, so I did not look into what went
wrong, and simply commented the autorelease message.
Thanks in advance!
-Saurabh
On May 8, 3:27 pm, Miguel Andrés Yáñez Barreto
<
migueland...@gmail.com> wrote:
> The first one is a constant, you don't alloc it or release it, because
> it's in the "data" section of the compiled code.
>
> You shouldn't use the second one with a constant string. The second
> one is a variable that you alloc, so you would have to release it
> yourself...
>
> Miguel Andrés Yáñez Barreto - Asistente Graduado
> Especialización en Seguridad de la Información
> Presidente de Maratones Uniandes
>
migueland...@gmail.com
>
> On May 8, 2009, at 14:19 , iPolly wrote:
>
>
>
>
>
> > hello,
>
> > im new here with iPhone programming. can anyone tell me the
> > differences between these 2 commands?
>
> > 1- NSString *s = @"Hello World"
> > 2- NSString *s = [[NSString alloc] initWithString:@"Hello world"];
>
> > when should i use the "alloc" one?
>
> > many thanks.
> > >
>
>
> smime.p7s
> 3KViewDownload