Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call method / NSDictionary question



On 2006-09-26, at 03:11:09, Andreas Kiel wrote:

Maybe somebody can give a hint how to solve the below problem. I have files which are plist/XML types where some values need to be retrieved. The values often show up as "dict, string". How do I bring those together?

Below an example
{|Dictionary|:" typedstreamÅËÑ@ÑÑÑ NSDictionaryÑÑNSObjectÖÑiíÑÑÑNSStringîÑ +NSParagraphStyleÜíÑÑÑNSParagraphStyleîÑCC@SÖÜíÑñó NSExpansionÜíÑÑ ÑNSNumberÑÑNSValueîÑ*ÑÑfùÉΩÑ,∆ÜíÑñóNSColorÜíÑÑÑNSColorîÑcÑff ÜíÑñóNSFontÜíÑÑÑNSFontîïÑ[28c]˛ˇHelveticaù $üüüüÜíÑñóNSBackgroundColorÜíцü†ÜÜ", | String|:" typedstreamÅËÑ@ÑÑÑNSAttributedStringÑÑNSObjectÖíÑÑÑNSS tringîÑ+1245ÜÑiIíÑÑÑ NSDictionaryîÑiíÑññNSParagraphStyleÜíÑÑÑNSParagraphStyleîÑCC@SÖÜ íÑññ NSExpansionÜíÑÑÑNSNumberÑÑNSValueîÑ*ÑÑfüÉΩÑ,∆ÜíÑññNSFontÜíÑÑ ÑNSFontîôÑ[28c]˛ˇHelveticaü$Ñc¢¢¢ÜíÑññNSColorÜíÑÑÑNSColorî ¢ÑffÜÜÜ"}

I looked at the NSDictonary class, but didn't find a working solution.

I believe this is an archive format but am not familiar with the NSArchiver. Should be an easy 'call method' though.


If it really is a .plist, then there is a utility 'plutil' which will convert binary plists to text ones. Also Carbon has some nice plist functions in CFPreferences.h (also I think in CFURLAccess.h) which will load a plist directly into a CFDictionaryRef regardless of the file's format. CFDictionaryRef is toll free bridged to NSDictionary.


Philip Aker email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-studio mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >call method / NSDictionary question (From: Andreas Kiel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.