Recent

Author Topic: Mac app preferences - reading strings  (Read 1440 times)

geraldholdsworth

  • Full Member
  • ***
  • Posts: 214
Mac app preferences - reading strings
« on: June 24, 2024, 06:01:32 pm »
I've started to use the code outlined here for macOS app preferences, but there is no method of reading back strings (only integers and booleans...even though the code given just does integers), although you can write them (by the looks of it). There is no Apple function to do it that we can map on to.

However, it must be possible to do, just long winded, as these are just plist files with, I presume, CFDictionary inside. So, how does one go about reading a back a preference string, given the key?
Is it just a case of loading the plist file in and converting it to a CFDictionary (or NSDictionary), then using the appropriate tools to read the required value?

geraldholdsworth

  • Full Member
  • ***
  • Posts: 214
Re: Mac app preferences - reading strings
« Reply #1 on: June 26, 2024, 01:53:06 pm »
Presumably, no response means that no-one knows.

That's fine - I've begun looking at the plist binary format and am thinking about writing my own class to read, write and update said files, instead of using the Apple route. So, watch this space.

 

TinyPortal © 2005-2018