On 13/7/10 5:00 PM, "Brian Christmas" <
email@hidden> wrote:
What I want to do is change the location of these to my app (if humanly
possible)
Then you can't use NSUserDefaults. You need to add them to an NSArray, then
use its writeToFile:atomically: method to write them to a .plist file.
Reading them in again is just a matter of using NSArray's
arrayWithContentsOfFile:.
It might be easier to use an AS record:
-- write to file
set myDefs to {DiskPath:tempDiskPath, DayReportDisplay:tempDayReportDisplay,
[...]}
set theArray to current application's NSArray's arrayWithArray_(myDefs)
theArray's writeToFile_atomically_("/path/to/bundle/file.plist", true)
-- read from file
set theArray to current application's NSArray's
arrayWithContentsOfFile_("/path/to/bundle/file.plist")
set {DiskPath:tempDiskPath, DayReportDisplay:tempDayReportDisplay, [...]}
to theArray as record
You'll also need to handle what happens the first time it reads and the file
doesn't exist or lacks some properties.
--
Shane Stanley <
email@hidden>