Subscribe
« Getting started with MonoTouch | Main | #songsincode »
Friday
Sep182009

UITabBarController - Xcode and MonoTouch

This two part screencast will walk through an example of creating a UITabBarController and adding a custom UITableViewController to it in both Xcode and MonoTouch.  I have tried to highlight the similarities and differences between the two frameworks/IDEs.

Having the option of creating iPhone applications in C# is intriguing and with the right project needs it could be a lifesaver.  While parts of the process are still a little rough around the edges, this is still an exciting project to follow/get involved with.

Part I: Creating the app in Xcode with Cocoa - click to watch

Part II: Creating the app in MonoDevelop with MonoTouch - click to watch

Also, here is the uitvc code template that was used to create the UITableViewController subclass: uitvc.template.xml  You will need to add this to ~/.config/MonoDevelop/templates/code (choose "Go to folder..." from the Finder menu and paste the directory to find it) and restart MonoDevelop. (Note: If you don't see templates/code in ~/.config/MonoDevelop, go to Preferences in MonoDevelop and click on Code Templates under Coding.  This should populate this directory.  You don't need to do anything else here, just close Preferences and follow the instructions above to add the file to the ~/.config/MonoDevelop/templates/code directory.)

UPDATE: I fixed the IntPtr constructor in the uitvc template.  It did not correctly pick up the name of the TableViewController subclass.  This new version should fix that.

If you have any questions, please visit http://monotouch.net.  Join the IRC at irc.gnome.org channel #monotouch.

Click the "kick it" link below to promote this story at DotNetKicks if you found this story helpful.

kick it on DotNetKicks.com

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (2)

References allow you to track sources for this article, as well as articles that were written in response to this article.

Reader Comments (19)

Excellent post. Thanks so much for doing this. Great template too!

September 18, 2009 | Unregistered CommenterTrustme1995

This is AWESOME! I haven't watched them yet, but spent all of Friday looking into creating my first iphone app and stumbled upon http://monotouch.net ... If you can create more videos on using it, it would be very appreciated (And I think you'll get quite a following).

September 20, 2009 | Unregistered CommenterCarlos Leasen

Thanks for the comments! There will be some more free content and there is also a plan in place for some highly detailed in-depth screencast training for a fee similar to http://www.peepcode.com.

September 20, 2009 | Registered Commenterbrentschooley

Do you have another link for the second one? Its stopping right in the middle for me.

September 21, 2009 | Unregistered CommenterJohn Sheehan

maybe a stupid question, but I'll ask anyway.

As a .net developer (C#) does it allows me to run windows platform with Mono Develop for development? Or am I still locked to Mac OS X? (thus buying an apple)

What version of C# does MonoTouch support?

Thanks

September 22, 2009 | Unregistered Commenteruzivatel

Yes, the screencast videos stop mid-video. Do you have full videos available somewhere? This is awesome.

September 22, 2009 | Unregistered CommenterSchnyder

The full video is here. I don't know why it is stopping mid-video for you as plenty of people (including myself) have had no problem viewing it.

That being said, if you are having trouble, I have also posted these on YouTube:
Xcode: http://www.youtube.com/watch?v=_xiLg_Zm10c&feature=channel_page
MonoTouch Part 1: http://www.youtube.com/watch?v=tL0LwcVRsJk&feature=channel_page
MonoTouch Part 2: http://www.youtube.com/watch?v=May8Ys7INss&feature=channel_page

September 22, 2009 | Unregistered CommenterBrent Schooley

@uzivatel: MonoTouch currently requires a Mac. The limitation is primarily due to needing a Mac to sign your application for distribution. You also need a Mac to use Interface Builder. In the future, it may be possible to do iPhone development on a Windows machine but at the moment that is not feasible.

September 22, 2009 | Unregistered CommenterBrent Schooley

thanks Brent.

2nd question, do I really need a Mac or will VMWare help there? I really hate Mac keyboards, so would like to keep my notebook and run virtual Mac OS X if possible. Or I'll look on "hackintosh"...

btw, eager to watch other videos, objective C is a mess for me, but I'm more than familiar with C# so yes, I would pay to watch the development...(I payed for snow leopard and don't own a Mac;-)

September 23, 2009 | Unregistered Commenteruzivatel

just a comment on the template... the ctor isn't linked to the class name field

September 24, 2009 | Unregistered Commenterblindahl

@uzivatel You can use whatever USB keyboard you want on a Mac. Same with the mouse.

There's no good way to run Mac OS X in a VM. It's technically possible, but doesn't run very well and requires a lot of hacks to even get it running at all. I'm not sure I would recommend that.

September 25, 2009 | Registered Commenterbrentschooley

@blindahl: I'm not sure I follow. The template was derived from working sample code from the monocatalog-md sample.

September 25, 2009 | Registered Commenterbrentschooley

@blindahl: The uitvc template is now fixed. Thanks for pointing this out!

October 4, 2009 | Registered Commenterbrentschooley

Hi

is it possible to have the whole project and files for this excellent demo for download?

MB

February 15, 2010 | Unregistered CommenterMarc Braun

An 18 minutes tutorial on writing an app that displays 3 literal strings. Coming from Windows Mobile I'm stunned by how hard it is to do even the simplest things. How can such a great device not have better development tools? I wish Apple would take some of the huge iPhone profits and invest in building better tools.

February 24, 2010 | Unregistered CommenterBill

Very informative post. Will share this with other developers.

April 28, 2010 | Unregistered Commentersingadi

A gink begins scathing his discernment teeth the initially time he bites off more than he can chew.

June 16, 2010 | Unregistered Commentercue tip

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>