Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding data to the disk



never mind I'm an idiot, I figured it out
On Friday, October 24, 2003, at 09:52 AM, April Gendill wrote:

Ok, I'm saving a document to disc. The document contains an exact
replica of the data added to a model for a disc to be burned.
the code I'm using uses the treenode structure from apple to maintain
the view. And when I restore the data the information goes into the
view perfectly. However, it fails to burn correctly. When I restore the
data, all that burns is the root folder and it is empty. the code used
to restore follows.... what am I missing?
Again, the only thing that burns is an empty folder at the topmost
level.

-(void)restoreSessionData:(NSDictionary*)theDict
intoNode:(TreeNode*)theNode{

NSEnumerator * iter =[[theDict allKeys] objectEnumerator];
NSString * currKey;

while(currKey =[iter nextObject]){
id currentObject =[theDict objectForKey:currKey];
if([currentObject isKindOfClass:[NSDictionary class]]){

DRFolder * folderObject =[DRFolder
virtualFolderWithName:currKey];
//I use a virtual folder so that there is no confusion if a user
moves something
id nodeData = [[FSFolderNodeData
alloc]initWithFSObject:folderObject];
TreeNode* newNode = [TreeNode
treeNodeWithData:nodeData];

[self _insertChild:newNode intoParent:theNode];
//this command is basically a rewrite of the _addNewDataToSelection
in the EDB example, and only
//maintains the view

NSDictionary * currentDict =[NSDictionary
dictionaryWithDictionary:currentObject];

[self restoreSessionData:currentDict intoNode:newNode];
}//end of new folder data item

else if([currentObject isKindOfClass:[NSString class]]){
NSString * fileName =currentObject;
DRFile * fileObject =[DRFile fileWithPath:fileName];

id nodeData =[[FSFileNodeData
alloc]initWithFSObject:fileObject];
FSTreeNode* newNode = [FSTreeNode
treeNodeWithData:nodeData];
[self _insertChild:newNode intoParent:theNode];
}//end of add file
}//end while
[outlineView reloadData];
}
_______________________________________________
discrecording mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/discrecording
Do not post admin requests to the list. They will be ignored.
_______________________________________________
discrecording mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/discrecording
Do not post admin requests to the list. They will be ignored.

References: 
 >Adding data to the disk (From: April Gendill <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.