Hi guys + gals, hope you can help with this cos it's driving me mad!
I've got a "Document based application" which I'm using java to develop. The project is called Battler.
I used InterfaceBuilder to lay out the main document window (MyDocument.nib) with various buttons linked to a class called "battleGrid" which I then instantiated. In my project I now have three source code files:
MyDocument.java
battleGrid.java
main.m
When my program starts up, the window (from MyDocument.nib) is displayed and somewhere an instance of battleGrid is created. A new window is displayed and a new instance of battleGrid created every time I select "New" from the File menu.
At certain points in the game I want the window corresponding to a particular instance of battleGrid to display a sheet. However, I don't know how to tell that instance what window to display the sheet on (it has to be the one associated with that instance of battleGrid).
Can anyone help please?
I know a nasty hack I can use to get round it, but it's not very pretty. It involves using a global variable....Sooooo, onto question 2!
How can I create a global variable?
Thanks for all your help.