title: Passing objects into NSOperation and ensuring correct memory management policies
body: <p>If I want to pass an object that was created on the main thread onto an NSOperation object, what's the standard way of doing to so that I'm not creating any memory management issues? Should I make my object's properties not have the 'nonatomic' attribute?</p>
  
  <p>Right now, I allocate the objects via [[[AClass alloc] init] autorelease], keep a copy of the instance on my main thread and then pass another copy into the NSOperation as part of an NSArray. When I try to iterate through the array list objects inside NSOperation class and access one of the AClass's properties, the debugger reports that one of the member properties of AClass's instance object is already zombied while others are not. The error I'm seeing is:</p>
  
  <pre><code>-[CFString retain]: message sent to deallocated instance 0x5a8c6b0
  *** -[CFString _cfTypeID]: message sent to deallocated instance 0x5a8c6b0
  *** -[CFString _cfTypeID]: message sent to deallocated instance 0x5a8c6b0
  </code></pre>
  
  <p>I can't tell who is releasing my string properties too early but the entire object instance has not been released. </p>
  
  <p>My class looks like:</p>
  
  <pre><code>@interface AClass
  {
     NSString *myTitle;
     NSString *myDescription;
  }
  
  @property (nonatomic, retain, readonly) NSString *myTitle;
  @property (nonatomic, retain, readonly) NSString *myDescription;
  
  @end
  
  @implementation AClass
  @synthesize myTitle, myDescription;
  - (void)dealloc
  { 
      [myTitle release];
      [myDescription release];
  }
  @end
  </code></pre>