CamelBones question
CamelBones question
- Subject: CamelBones question
- From: Pierre Vaudrey <email@hidden>
- Date: Mon, 10 May 2004 22:11:41 +0200
As an exercise I'm translating the AddressBook application
http://www.macdevcenter.com/pub/a/mac/2001/08/24/cocoa.html from ObjC
to Perl using CamelBones.
I need help to translate in Perl initWithContentsOfFile and writeToFile
in this part of code ( the rest of code is OK ) :
- (void)awakeFromNib
{
// We'll implement the backup file scheme that was discussed in the
end of the column.
recordsFile = [NSString
stringWithString:@"~/Library/Preferences/AddressBookData.plist"];
recordsFile = [[recordsFile stringByExpandingTildeInPath] retain];
records = [[NSMutableArray alloc]
initWithContentsOfFile:recordsFile];
if ( nil == records ) {
records = [[NSMutableArray alloc] init];
}
}
- (void)saveData
{
[records writeToFile:recordsFile atomically:YES];
}
Pierre
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.