Re: How to upload dictionary to online URL
Re: How to upload dictionary to online URL
- Subject: Re: How to upload dictionary to online URL
- From: Keith Renz <email@hidden>
- Date: Sat, 29 May 2004 08:18:22 -0400
- Resent-date: Sat, 29 May 2004 08:19:11 -0400
- Resent-from: Keith Renz <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: Cocoa-Dev List <email@hidden>
I would like to upload a very small dictionary (~1K) to an online URL
(ftp or http). I can download just fine with NSURLConnection &
NSURLDownload, but uploading is not so straight forward. What is the
simplest way to do this?
If your dictionary contents is all property list objects (NSData,
NSDate,
NSNumber, NSString, NSArray, or NSDictionary objects), you can use the
bellow NSDictionary method. If not, convert your contents to NSData
and
then use the bellow method.
- (BOOL)writeToURL:(NSURL *)aURL atomically:(BOOL)flag
Writes a textual description of the contents of the receiver to aURL.
If the
receivers contents are all property list objects (NSData, NSDate,
NSNumber, NSString, NSArray, or NSDictionary objects), the location
written
by this method can be used to initialize a new dictionary with the
class
method dictionaryWithContentsOfURL: or the instance method
initWithContentsOfURL:.
Satoshi,
I've tried this several times and it does not work. (I probably should
have stated this in my initial post.) My dictionary contains 2
NSStrings, 1 NSDate and 1 NSNumber; it should work. According to the
archives, this is for local file systems only, but it does not specify
this in the NSDictionary docs.
Keith
_______________________________________________
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.