• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem retrieving Arrays from save file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem retrieving Arrays from save file


  • Subject: Problem retrieving Arrays from save file
  • From: Brian Christmas <email@hidden>
  • Date: Sat, 13 Aug 2011 19:19:23 +1000

G'day scripters

I'm using the following to save and retrieve the data (theData) for a Table.

I've tried to add 4 Arrays via bindings and the Array Controller, but while the data for the Arrays seems be be saved, I can't work out how to retrieve them.

Hopefully the following cut and paste code is understandable. The Table data is saved and retrieved OK.

Any advice appreciated, please

Regards

Santa

property   theTempDaysArrayStore : missing value
    property   theTempMonthsArrayStore : missing value
    property   theTempWeeksArrayStore : missing value
    property   theMonthDaysArrayStore : missing value
    
all 4 bound to Array Controller


on saveData_(sender)
         set thetempData to current application's NSKeyedArchiver's archivedDataWithRootObject_(my theData)
         thetempData's writeToFile_atomically_(FILE_PATH, true)  
end saveData_

   

on importData_() 
        try
            -- set openedFilePath to op's URLs()'s objectAtIndex_(0)'s |path|()
             set theArrayController's theData  to setTheData_(current application's NSKeyedUnarchiver's unarchiveObjectWithFile_(File_Path))
             on error errmsg
            display dialog errmsg
        end try
end importData_ 

This sets up the Data to be stored for each entry, note the last 4 are Arrays


 set anEntry to {theActiveColumn:theActiveStoreVariable,theStartDateColumn:theStartDateStoreVariable,theTypeColumn:theTypeStoreVariable,theDayStoreColumn:theDaysDisplay,theMonthsColumn:theMonthsDisplay,theWeeksColumn:theWeeksDisplay,theTextStoreColumn:theTextStoreVariable,theSpeakColumn:theSpeakStoreVariable,theVoiceColumn:theVoiceStoreVariable,theiTunesColumn:theiTunesStoreVariable,thePlaylistColumn:thePlaylistStoreVariable,thePlayListRandomColumn:thePlaylistRandomStoreVariable,theVolumeColumn:theVolumeStoreVariable,theDisplayFlagColumn:theDisplayFlagVariable,theMessageDisplayStoreColumn:theMessageDisplayStoreVariable,theTempDaysArrayStore:theHoldingDaysArray,theTempMonthsArrayStore:theHoldingMonthsArray,theTempWeeksArrayStore:theHoldingWeeksArray,theMonthDaysArrayStore:theHoldingMonthDaysArray}
 return anEntry



This is where I'm trying to retrieve the Arrays, nothing is logged.


        log "Loading_________________"&return&return
         set my theHoldingDaysArray to (my theData's objectAtIndex_(tempRow)'s valueForKey_("theTempDaysArrayStore"))
         set my theHoldingMonthsArray to (my theData's objectAtIndex_(tempRow)'s valueForKey_("theTempMonthsArrayStore"))
         set my theHoldingWeeksArray to (my theData's  objectAtIndex_(tempRow)'s valueForKey_("theTempWeeksArrayStore"))
         set my theHoldingMonthDaysArray to (my theData's  objectAtIndex_(tempRow)'s valueForKey_("theMonthDaysArrayStore"))
        log "___________________"&return&return



This is data from one Array






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Problem retrieving Arrays from save file
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Is it possible to simplify this code?
  • Next by Date: Re: Problem retrieving Arrays from save file
  • Previous by thread: Re: Is it possible to simplify this code?
  • Next by thread: Re: Problem retrieving Arrays from save file
  • Index(es):
    • Date
    • Thread