| |
iPhone ~ First MonoTouch app
August 2009
Thanks to @migueldeicaza's pointer to
@redth's
YouTube screencast of the
MonoTouch Hello World sample I was finally able to
properly play with the
MonoTouch beta.
I took some screenshots while following along with YouTube
(and yes, they are almost identical to these :-|)
NOTE: thanks to the MonoTouch team and
@redth/Jon from
webloungers.com - I'm just playing around with their stuff here.
p.s. thanks to RealVNC for facilitating MonoDevelop-ment on my two-screen Vista
PC against my Mac Mini in the other room :)
 |
First: create a new iPhone MonoTouch Project |
 |
Notice how the project structure looks very similar to VisualStudio. You even
get a basic Main.cs and MainWindow.xib (with designer.cs 'codebehind') created
for you. |
 |
The boilerplate code in Main.cs will get your app up-and-running... but it won't
DO anything.
Double-click MainWindow.xib to start Apple's Interface Builder |
 |
Interface Builder will NOT seem as familiar as MonoDevelop. In fact it will take
a while to get used to.
Drag some controls onto a Window, create "delegate"s and wire them up. |
 |
When you Save the xib file, MonoTouch notices and re-generates the desiger.cs...
Now it has Properties for the two controls you placed on the window. |
 |
Now add some *really* basic code:
int taps = 0;
buttonTap.TouchDown += delegate {
labelTap.Text = string.Format("Tap: {0}, ++taps);
}
|
 |
Choose Run and start tapping away in the emulator!
Thanks Jon!!! |
|
|
Useful links for MonoTouch
|