Re: Problems saving NSDictionary with writeToFile
Re: Problems saving NSDictionary with writeToFile
- Subject: Re: Problems saving NSDictionary with writeToFile
- From: Colin Cornaby <email@hidden>
- Date: Sun, 9 Feb 2003 18:28:43 -0800
No, I'm quite sure the file never makes it, and this is re-produceable
on other machines. The path I am passing in my app is /Test2.xscheme
(and I have tried /Users/ColinCornaby/Test2.xscheme). The permissions
are ok, and the method has worked before, but not on this specific
instance. The app will be handling much larger situations too. Both
flags for atomically also make no difference.
--Colin Cornaby
On Sunday, February 9, 2003, at 06:10 PM, mw wrote:
Did you check to see if the dictionary was being written to file?
Perhaps
you should check "thePath" to see if the xml file exists. Also, are
you 100%
sure that the path is valid? I have never had any problems with this
method
before.
mw
--
"Software exists to solve your problems. We exist to make the
problems."
Microsoft
On 2/9/03 8:46 PM, "Colin Cornaby" <email@hidden> wrote:
I'm having trouble saving a dictionary to an XML plist. I cannot
figure
out any reason why the file should not save. Permissions and Path
names
are ok, and no exceptions are raised. However, writeToFile returns
false.
Here is the saving code:
-(void)writeAsFileToPath:(NSString *)thePath atomically:(BOOL)atomYN{
NSMutableDictionary *finalDict = [[NSMutableDictionary alloc]
init];
[finalDict setObject:theFiles forKey:@"files"];
[finalDict setObject:theThemeNames forKey:@"variations"];
if([finalDict writeToFile:thePath atomically:atomYN]){
}else{
NSLog(@"There was a problem saving the file");
}
[finalDict release];
}
The code always logs the error to the console with the example I am
using, so I know that writeToFile is returning false.
The dictionary itself appears to be fine, and is spilling out a
description properly. I have posted the description of the
NSDictionary
online (it is 979 k, but most of the size comes from raw data in the
dictionary, there are not many actual keys).
http://conundrumsoft.com/NSDictProb.html
It is a largely sized dictionary. Could that be the problem?
--Colin Cornaby
_______________________________________________
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.