Skip to content

Instantly share code, notes, and snippets.

@glarizza
Created August 4, 2012 04:24
Show Gist options
  • Save glarizza/3254500 to your computer and use it in GitHub Desktop.
Save glarizza/3254500 to your computer and use it in GitHub Desktop.
RubyCocoa: Hash from Plist Data
require 'osx/cocoa'
include OSX
nsdata = xml.to_ns.dataUsingEncoding(NSUTF8StringEncoding)
obj = OSX::NSPropertyListSerialization.objc_send(
:propertyListFromData, nsdata,
#:mutabilityOption, OSX::NSPropertyListMutableContainersAndLeaves,
:mutabilityOption, OSX::NSPropertyListImmutable,
:format, nil,
:errorDescription, nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment