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: Satoshi Matsumoto <email@hidden>
- Date: Sat, 29 May 2004 14:05:13 +0900
Hi Keith,
on 04.5.29 1:14 PM, Keith Renz at email@hidden wrote:
>
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
receiver’s 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:.
Hope that helps.
Satoshi
-----------------------------------------------------
Satoshi Matsumoto <email@hidden>
816-5 Odake, Odawara, Kanagawa, Japan 256-0802
_______________________________________________
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.