• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to upload dictionary to online URL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: cocoa-dev digest, Vol 2 #4268 - 14 msgs
  • Next by Date: "UseWebKit" in NSAttributedString
  • Previous by thread: Re: How to upload dictionary to online URL
  • Next by thread: Re: How to upload dictionary to online URL
  • Index(es):
    • Date
    • Thread