discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString:stringWithFormat: Example? (OPENSTEPIFIED)


From: Patrick Stein
Subject: Re: NSString:stringWithFormat: Example? (OPENSTEPIFIED)
Date: Fri, 29 Sep 2000 11:50:39 +0200

richard@brainstorm.co.uk wrote:
>
>#include <Foundation/Foundation.h>
>main()
>{
>  CREATE_AUTORELEASE_POOL(pool);
>  NSString     *myString;
>
>  myString = [NSString stringWithFormat: @"A C string '%s' and a number 
'%d'",
>    "hello", 42];
>  NSLog(@"Result is - @%", myString);
>  RELEASE(pool);
>}
>
The above will only work on GNUSTEP not OPENSTEP - please keep in mind to be 
OPENSTEP compliant you
have to use the common subset.

CREATE_AUTORELEASE_POOL(pool);
should be
NSAutoreleasePool *myPool = [[AutoreleasePool alloc] init];

and 
RELEASE(pool);
should be
[myPool release];



                                             keep on moving - jolly



reply via email to

[Prev in Thread] Current Thread [Next in Thread]