On 9 Mar 2005, at 18:45, Jasper Van Proeyen wrote:
Hi,
I have a second nib in my ASS project with a window called "HighScores"
I use the "on will quit theObject" handler before the app quits, to
store the defaults in my plist file.
My problem:
I want to save all the data from a table from the "HighScores" window
to the plist, but I get a NSReceiverEvaluationScriptError when I try
to get the data.
Here's my piece of code:
set creditsList to contents of every data cell of every data row of
data source of table view "creditsScore" of scroll view "creditsScore"
of window "HighScores"
My guess is that I should say somewhere in my code that window
"HighScores" is in the second nib (not the MainMenu.nib), but I
wouldn't have a clue how…
Any suggestions?
No, you don't have to specify which nib a window belongs to.
Referencing the window by name as you are doing is enough.
... So on the face of it I can't see anything wrong with your code.
One suggestion. Make sure that "Release when closed" is UNCHECKED in
the attributes for the window in Interface Builder. If it is checked,
then when the window closes, as it will when you quit, then as far as
the application is concerned the window won't exist, so a reference to
the data source of the table of the window will indeed generate the
NSReceiverEvaluationScriptError error.