Re: writeToFile:atomically ... again
Re: writeToFile:atomically ... again
- Subject: Re: writeToFile:atomically ... again
- From: Tommy Nordgren <email@hidden>
- Date: Sun, 10 Jun 2007 19:36:14 +0200
On 10 jun 2007, at 18.00, Nima Talebi wrote:
Hi
This is my second attempt in sending this email, (trying to be
complete
meant the email was too large and was bounced).
...
I know this has been uttered over and over again the list, but I
haven't
found a solution, or any suggestions that I've not already
accounted for
such as permissions and checking types etc. I'll try and be as
complete as
possible here.
Problem Method: [NSDictionary writeToFile:atomically:] fails
everytime, and
I don't know why.
Test Case: I've pasted the original email here...
http://dark-code.bulix.org/f0dcgo-44875?raw
Results/Problem:
As you can see, the writeToFile:atomically works perfectly fine for
NSArray
of NSNumbers and NSStrings, however the resultant NSDictionary fails.
Pre-empted Answered to some Questions:
1. The destination directory (as you have seen) allows for process
owner to
read and write to.
2. an NSDictionary of keys vs values of the following permutations
have been
tried with the same results...
NSStrings vs NSString
NSNumbers vs NSStrings (example in this email)
NSNumbers vs NSNumbers
NSStrings vs NSNumbers.
3. The `NULL' in the above outputs are actually NSStrings (ie
@"NULL"), not
real `nil's or `NULL's, obviously.
4. I can't use NSArchive because I *need* the results in XML
format, and if
I'd rather do it this way.
5. I have read the documentation ...
This method recursively validates that all the contained objects are
property list objects (instances of NSData, NSDate, NSNumber,
NSString,
NSArray, or NSDictionary) before writing out the file, and returns
NO if all
the objects are not property list objects, since the resultant file
would
not be a valid property list.
...and as you can see, all my objects conform to the rules.
I hope I've been as complete as possible in composing this problem, if
anyone can tell me why the method for the NSDictionary fails, I'd
appreciate
it very much. Cheers.
Nima
You are trying to write directly to a directory that is owned by root.
------------------------------------------------------
"Home is not where you are born, but where your heart finds peace" -
Tommy Nordgren, "The dying old crone"
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden