i have a NSOperationQueue with NSOperation, in my NSOperation .h i have this property:
@interface MyOperationClass : NSOperation
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (strong, nonatomic) NSManagedObject *myObject;
@property (nonatomic, retain) NSMutableArray *myArray;
@end
and this in the dealloc of the NSOperation in the .m file:
- (void)dealloc {
[__fetchedResultsController release];
[__managedObjectContext release];
[myObject release];
[myArray release];
[super dealloc];
}
in another class i add the operation in the queue in this way:
MyOperationClass *myOperation = [[MyOperationClass alloc] init];
[myOperationQueue addOperation:myOperation];
[myOperation release];
but give me a bad_exc_access on the line of [myArray release]; what i wrong?
EDIT: i notice that in the code i do this:
wikiEpisodeArray = [NSMutableArray arrayWithArray:otherArray];
maybe is this? i don't have initialized it with [NSMutableArray alloc] ?
EDIT 2: i have another similar problem, i have also this variable:
@property (nonatimc, retain) NSString *previousTime;
and i initialized it in this way:
previousTime = [[NSString alloc] init];
and in the code i never release it, only in the dealloc, and now i receive a bad exc access on this line:
[previousTime release];
in the dealloc... why?
MyOperationClass"myArrayobject. If it were my code, I'd run Xcode's Instruments and use the ObjectAlloc template to see who is retaining and releasing the elements of your object. - Michael Dautermannstrong" in your interface declaration. I don't have a lot of experience with ARC yet, personally, but I thought the big "win" of ARC was that you didn't have to mess with managing dealloc or releases. - Michael Dautermann