>> A follow up...
>> 
>> Adding this to my NSDocument subclass:
>> 
>> - (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName
>> forSaveOperation:(NSSaveOperationType)saveOperation
>> originalContentsURL:(NSURL *)absoluteOriginalContentsURL error:(NSError
>> **)outError
>> {
>>    NSError* error;
>> 
>> NSFileWrapper* myFileWrapper = [self fileWrapperOfType:@"MyPackageType"
>> error:&error];
>> 
>> [myFileWrapper writeToURL:absoluteURL
>> options:NSFileWrapperWritingWithNameUpdating
>> originalContentsURL:absoluteOriginalContentsURL error:&error];
>> 
>>    return (YES);
>> }
>> 
>> 
>> This still takes 40 seconds
> 
> Alright, I’m running low on ideas now. But if you can make a sample project
> that exhibits the issue, I’ll cheerfully take a look at that.
> 
> 

Here is a test project, built from Apple's Cocoa document template.

http://www.xericdesign.com/archive/FilePackageTestProject.zip


You'll need to provide your own package of type "mydoc". It can be anything
at all... Preferably a few thousand files. The entire Document subclass for
I/O is:

-(BOOL)readFromFileWrapper:(NSFileWrapper *)fileWrapper ofType:(NSString
*)typeName error:(NSError **)outError
{
    [self setDocumentFileWrapper:fileWrapper];
    
    return YES;
}


-(NSFileWrapper *)fileWrapperOfType:(NSString *)typeName error:(NSError
**)outError
{
    return documentFileWrapper;
}

Opening a package is instantaneous, but immediately saving that same package
takes 40 seconds with my 7500-file test package.

Surely I am doing something wrong here and it can be made to go much faster,
right?

Trygve




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to