Re: Memory Management and objects creation via static methods...

2008-03-24 Thread Samvel
Sorry for terminology. I came from C++ and still have some problems with it especially calling things in Objective-C way :). Thanks for descriptive answer. Actually I meant to release string in dealloc method of my class. Just was thinking about next question regarding NSNotificationCenter at

Re: Memory Management and objects creation via static methods...

2008-03-24 Thread Sherm Pendley
On Tue, Mar 25, 2008 at 12:19 AM, Samvel <[EMAIL PROTECTED]> wrote: > > Lots of classes define static methods that create objects for instance: > > Class NSString: >+(id) stringWithString: (NSString *) string; > > or Class NSArray: >+(id) arrayWithObjects: (id) firstObj, ...; > > I

Re: Memory Management and objects creation via static methods...

2008-03-24 Thread Jens Alfke
On 24 Mar '08, at 9:19 PM, Samvel wrote: Should I retain string in init? Yes. When you store an object pointer in an instance variable you almost always want to retain it, so the object pointed to won't get deleted. If the pointer came from an "init" method, that object is already retai

Re: Memory Management and objects creation via static methods...

2008-03-24 Thread Ken Thomases
Hi, On Mar 24, 2008, at 11:19 PM, Samvel wrote: Lots of classes define static methods that create objects for instance: Class NSString: +(id) stringWithString: (NSString *) string; or Class NSArray: +(id) arrayWithObjects: (id) firstObj, ...; A minor nit-pick about termino

Memory Management and objects creation via static methods...

2008-03-24 Thread Samvel
Hi, Lots of classes define static methods that create objects for instance: Class NSString: +(id) stringWithString: (NSString *) string; or Class NSArray: +(id) arrayWithObjects: (id) firstObj, ...; I am really confused about next situation and memory management of objects cr