End Of Method Releasing Order?
End Of Method Releasing Order?
- Subject: End Of Method Releasing Order?
- From: Chunk 1978 <email@hidden>
- Date: Mon, 1 Jun 2009 20:46:27 -0400
does it matter which order objects are released at the end of a
method? example:
-=-=-=-=-
- (void)applicationWillTerminate:(NSNotification *)notification
{
FourLines *fourLines = [[FourLines alloc] init];
fourLines.field1 = field1.text;
fourLines.field2 = field2.text;
fourLines.field3 = field3.text;
fourLines.field4 = field4.text;
NSMutableData *data = [[NSMutableData alloc] init];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc]
initForWritingWithMutableData:data];
[archiver encodeObject:fourLines forKey:kDataKey];
[archiver finishEncoding];
[data writeToFile:[self dataFilePath] atomically:YES];
[archiver release];
[data release];
[fourLines release];
}
-=-=-=-=-
at the end i'm finished with archiver, data and fourLines, but does it
matter in this case which one i release first?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden