passed record to NSMutableArray not writing to file

Hi All,

Have been in ObjC land for a while - getting back to ASOC and stuck on writeToFile

I have an array controller which is bound to two tables with a AS record for the data. This all works fine.

There’s an array element called “zipfiles”

I made a list of records from a file list:

set modDatesList to {}
    repeat with i from 1 to count of completeFileList
        set thisFile to item i of completeFileList as string
        set thisSize to size  of (info for (thisFile as POSIX file))
        copy {localFile:thisFile,fileSize:thisSize} to end of modDatesList
 end repeat

and then

set thisMut to NSMutableArray's alloc()'s init()
thisMut's addObjectsFromArray_(Backupset's arrangedObjects())
set thisObj to thisMut's objectAtIndex_(0)
thisObj's setValue_forKey_(modDatesList, "zipfiles")

thisMut's writeToFile_atomically_(FILE_PATH, true)

I won’t write the updated array with the the list records to plist

If I pass it a simple


set modDatesList to [{"A","B","C"},{"1","2","3"}}

it works but oddly not all the time. I check the plist and it doesn’t get updated, only sometimes. No errors reported. A bit perplexed why this isn’t a simple matter. Well, it probably is. Any thoughts appreciated.

Thanks, Rob

Add some logging. Log the class as well as the contents of things like thisObj and modDatesList at key points.

Yes- after a few more hours of logging and searching I had forgot that I had images in my record data (old long story) which I usually remove at quit time. I didn’t remove them in this case so no writing to file. Also was passing an applescript date to the array which failed very silently - fixed with Shane’s ASDateToNSDate ford. Thanks for that time saver Shane!

Rob