Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Programmer Help > memory (de)allo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 3742 of 3882
Post > Topic >>

memory (de)allocation in a command line Cocoa application

by "Aaron Gray" <ang.usenet@[EMAIL PROTECTED] > May 17, 2008 at 10:36 PM

Hi,

I am trying to learn to program in Objective-C and Cocoa, still getting
the 
basics though.

What I want to know about is memory management.

If I have the following program :-

int main( int argc, char *argv[])
{
    NSFileHandle *stdout = [NSFileHandle fileHandleWithStandardOutput];

    NSString *test = [NSString stringWithCString: argv[0]];

    Char *cstring = [test UTF8String];

    [stdout writeData: [NSData dataWithBytes: cstring length: strlen( 
cstring)];

    [stdout fileClose];

    [test autorelease]

    return 0;
}

I am getting messages saying "autoreleased with no pool in place".

How do I go about creating a pool if thats what I need to do ?

Otherwise how do I do the memory management.

Many thanks in advance,

Aaron
 




 5 Posts in Topic:
memory (de)allocation in a command line Cocoa application
"Aaron Gray" &l  2008-05-17 22:36:33 
Re: memory (de)allocation in a command line Cocoa application
"Aaron Gray" &l  2008-05-17 23:24:20 
Re: memory (de)allocation in a command line Cocoa application
"Aaron Gray" &l  2008-05-18 00:23:32 
Re: memory (de)allocation in a command line Cocoa application
Gregory Weston <uce@[E  2008-05-17 20:12:11 
Re: memory (de)allocation in a command line Cocoa application
"Aaron Gray" &l  2008-05-18 01:21:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 1:29:37 CST 2008.