NSPersistentDocument initForURL:withContentsOfURL
NSPersistentDocument initForURL:withContentsOfURL
- Subject: NSPersistentDocument initForURL:withContentsOfURL
- From: "Mu Lin" <email@hidden>
- Date: Mon, 26 Sep 2005 12:36:56 -0700
- Importance: normal
- Priority: normal
Hi, All:
I am using NSPersistentDocument. I overrided initWithType as such to
provide some initial contents for newly created documents:
- (id)initWithType:(NSString *)typeName error:(NSError **)outError
{
NSURL *tempURL = [NSURL URLWithString:@"file://localhost/Users/
SomeBody/Desktop/defaultFile"];
return [self initForURL:nil /* using nil here to get "untitled"
and "untitled 2" file display name. */
withContentsOfURL:tempURL
ofType:@"XML"
error:outError];
}
It works fine during the opening but when I save the documents to
another file such as "myFile2" using "save as..", the "defaultFile"
was blown away. How can I get around of this behavior?
Regards
MarkThis mail server is the property of Spectral Dynamics, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden