when to use self.property in init methods in objective-c, how to initialize arrays in init methods
<p>I'm confused on what the proper way to write custom init methods for youw own subclass in terms of memory management, custom subclasses, and arrays.  If I have properties like:</p>

<pre><code>@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSMutableArray *array;
@property (nonatomic, retain) SomeSubclassOfNSObject *object;

@interface SomeSubclassofNSObject 
@property (nonatomic, retain) NSString *category;
</code></pre>

<p>How do I write my init method?</p>

<p>do you do: </p>

<pre><code>initWithName:(NSString *)aName object:(SomeSubclassOfNSObject *)anObject {
    if (self = [super init]) {
       self.name = aName; // or do you do name = aName or name = [aName copy] autorelease] or name = [NSString alloc] initWithFormat:@"%@", aName]
       self.object = anObject; // do I need to make a copy of this object so they don't point to the same object?

    // loop through NSMutableArray and copy the objects?
    // not really sure what to do for arrays.      
    }
    return self;
}
</code></pre>
