on NSString usage
on NSString usage
- Subject: on NSString usage
- From: "Chong Hiu Pun" <email@hidden>
- Date: Thu, 1 Aug 2002 15:41:19 +0800
I have a class variable:
NSString *strResult;
which will be modified inside a few different function.
-(void) functionA
{
....
strResult=@"aaa";
}
-(void) functionB
{
....
strResult=@"bbb";
}
-(void) functionC
{
....
strResult=@"ccc";
}
-(NSString*) GetIt
{
....
return strResult;
}
I will execute functionA , functionB and then functionC and get the strResult.
My question is:
1.) In this case, how the memory managed. Do I need to call [alloc] and [init]
on strResult before enter into functionA
2.) After running out of the scope of functionC, will strResult became
autorelease, and I lost the content of strResult inside funtion GetIt?
Thank you very much!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.