• 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
Am I Reinventing the Wheel? (Part I)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Am I Reinventing the Wheel? (Part I)


  • Subject: Am I Reinventing the Wheel? (Part I)
  • From: Charles Jenkins <email@hidden>
  • Date: Thu, 08 Jan 2015 07:43:14 -0500

"When you try to reinvent the wheel, most often what you end up with is a flat tire."

I need to deal with two issues that are probably already handled in some Cocoa API I just haven't found yet. This email asks about the first of these issues.

I'm writing data to XML. When you create a node and set its string contents, the node will happily accept whatever string you give and allow you to serialize information XML deserialization cannot then recreate. In my case, the string in question contained curled quotes. I could serialize and save the data—and if I remember correctly* the output looked good when I inspected the file on disk—but reading it back and deserializing it led to disaster! Right now I'm using NSString stringByAddingPercentEncoding: and having no further problems with curled quotes, but I'm sure that's a poor long-term solution.

*I encountered this problem a few weeks ago and put off a final solution by using the percent encoding.

Is there already a Cocoa API call that would convert a string to use HTML entities so I could safely put any string into an XML node?

—

Charles

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


  • Follow-Ups:
    • Re: Am I Reinventing the Wheel? (Part I)
      • From: Jens Alfke <email@hidden>
    • Re: Am I Reinventing the Wheel? (Part I)
      • From: Keary Suska <email@hidden>
    • Re: Am I Reinventing the Wheel? (Part I)
      • From: Aandi Inston <email@hidden>
  • Prev by Date: Re: NSScrollView autolayout (10.10)
  • Next by Date: Am I Reinventing the Wheel? (Part II)
  • Previous by thread: Re: Displaying a scaling, relative time or date
  • Next by thread: Re: Am I Reinventing the Wheel? (Part I)
  • Index(es):
    • Date
    • Thread