Hello again marc, I’m having problems getting started with Fire. I’ve setup Fire correctly, I think, although the following screen confused me:
In particular, the Cocoa Path edit box shows $(Fire.app)/Contents/Resources/Toffee SDKs in grey text. It isn’t clear whether this is the recommended entry here. It’s made more awkward by the fact that the text disappears as soon as you start typing. In any case, even if you try to enter $(Fire.app)/Contents/Resources/Toffee SDKs the entry isn’t retained the next time you go back into Fire preferences.
After I’ve created the project/solution I am presented with the following screen:
Anyhow, I decided to press on and did a Project -> Add New File. I accepted the defaults on the next screen and accepted the default filename of Codefile.swift. I then pasted in the "The magic happens here." piece of code from the tutorial. any attempts then to build or Run are met with an alarming error screen. The details of the error message seem to have changed now. Previously it talked about the Fire Setup not being correct. Now it looks like this:
Just one small question. Now that I can successfully create a Cocoa app with an empty window, where would you suggest is the best place to learn about adding labels and buttons and other controls? Also, would such information be specific to Fire or would generic Swift material help here?
Sorry if I’m being a bit dim, here, but I guess my brain hasn’t quite gelled with the Swift way of doing things yet.
Would I be right in thinking that I should use Xcode to define the UI elements and that this is done by opening the xib files in Xcode? Is there any form of synchronisation between Fire and Xcode, so that one can switch between them with single keypresses according to the task in hand?
It’s all so different from Delphi, that’s for sure!
The problem comes when I try to attach code to the button. At this point, the instructions in the SO thread lose connection with what I see on screen. The SO thread says this:
One thing to note is here we use NSButton.
In the storyboard, you should see a view controller (a yellow cube).
click on this view controller
check the right panel and the 3rd icon on the top. Click it
You will see "Custom Class" "Class" "Module"
In "Class", drop down and choose the view controller class you implemented
Make sure you implemented this buttonTap function in the class
In the storyboard make sure you see the button
hold the control key, click on the button and drag to the yellow cube
release your mouse
see the buttonTapped function show in the menu popping up
choose this function
It falls down at the second line. I don’t even see anything recognisable as the Storyboard, let alone the View Controller (yellow cube).
I swear sometimes that the end of the world will be caused by some piece of technical documentation not corresponding to actual reality! Or by a mistake involving diplomatic translators but that’s not relevant here!
Ah! Excellent. I feel like I’m getting there slowly but surely. This framework certainly gives the impression of being built on some solid principles, even if I am having initial difficulty grokking those principles.
I’ll study those docs tomorrow I think. Thanks for your help and patience marc. It’s much appreciated!