Jump to content

Do I need to learn Objective-C to program the iPhone?

adfm's Photo
Posted Sep 21 2009 02:06 PM
7610 Views

Is Objective-C my only option if I want to develop for the iPhone OS?

Tags:
2 Subscribe


7 Replies

+ 1
  beth_freeman's Photo
Posted Sep 29 2009 10:48 AM

It is if you want to create native apps. There are a number of "helper" services now that let you design apps visually, and they generate code, but you will pay for these services (e.g. http://www.swebapps.com/).

You can also develop web applications using HTML, CSS and Javascript that run in the iPhone Safari browser. Via css extensions and javascript extensions for iPhone specific touch gestures and look & feel, you can make a web app look very much like a native app, although of course, it's all within the Safari browser.

Hope this helps.
-1
  pemungkah's Photo
Posted Nov 04 2009 07:00 PM

I'd mention iPhone Wax (apps written in Lua) and NimbleKit (apps in Javascript).

I still agree that Objective-C is going to be the best possible way to go, but there are near-native alternatives available. These are going to call into UIKit, so they'll work for basic apps, but you won't necessarily have every API; OpenGL also won't be performing at the highest possible speed.
+ 2
  rlopes's Photo
Posted Nov 05 2009 07:51 PM

Hi,

I have been working on the iPhone too and I was like many unwilling to learn Objective-C and its odd syntax.

So I have been looking around.
I can recommend several options if you want to avoid writing any Objective-C code:

- App Titanium which makes possible to write apps in HTML/CSS/Javascript and more. This also allow you to create applications for Mac, Windows and Android. The price is that not everything is possible but you can get to a result quickly.

- MonoTouch from Novell based on the free .Net framework Mono. This is one is not 100% free, but not expensive at all. It allows you to write pretty advanced iPhone apps in .Netand C#. The resulting binary is even compiled in native code. They map the Cocoa API pretty well.

- If you are not in a hurry, Flash CS5 to be released later will allow you to write your apps using Flash and ActionScript while compiling in native code too.

- For a game I can also recommend Unity 3D for Iphone, again based on Mono and C# with nice tools to speed up development. It also compiles into native code. 100's of game are using it. It is not free though.

- And the most common option probably is using C as much as possible, since you can write in C in XCode. You can rely on the visual designer to build up your interface and generate the underlying Objective-C code, and write all the logic in C. However you still need to use some Objective-C to make API calls to the iPhone features, but you don't need to be an Objective-C guru.

Hope this helps.

Cheers,

Richard
0
  Alasdair Allan's Photo
Posted Mar 17 2010 09:35 AM

If you include Flash there are now basically four platforms you can use to build native applications on the iPhone. Firstly there is the traditional Cocoa touch and Objective-C route, this is the best supported, documented and mature of the three. Even if you don't know Objective-C, the language is fairly easy to learn if you already know a C-derived language and have a basic grasp of object-oriented programming. If you want to develop seriously for the iPhone platform I'd recommend getting as close to the metal as you can and using the official SDK.

However there are alternatives...

Monotouch from Novell which allows you to build C# and .NET based applications on the iPhone and iPod touch. It comes in two editions: Professional and Enterprise. A license for the Professional Edition, intended for individual use, costs $399 per year. While the Enterprise Edition, intended for corporate use, costs $999 per year (although you can buy a 5 developer pack for $3,999 per year). Alternatively you can download an evaluation version that enables development and testing against the iPhone simulator only. I've played with MonoTouch fairly extensively and I've not found it to be particularly stable, especially when using the MonoDevelop development environment.

Then there is PhoneGap, it's an open source development platform for building cross-platform mobile applications with Javascript developed by Nitobi. On the iPhone it works by providing a pre-built Xcode project containing Objective-C classes that wrap the iPhone’s native capabilities (e.g. geo-location, vibration, and accelerometer support) and exposes these capabilities to Javascript. You can then compile your application as a hybrid of native Objective-C and Javascript inside Xcode.

The PhoneGap platform is device agnostic, allowing you to build an application for the iPhone, Android, and Blackberry devices simultaneously. If you've got a lot of Javascript development experience, building applications using the PhoneGap framework is a reasonable alternative to building all native applications in Objective-C. It certainly seems to be a lot more stable than MonoTouch.

Finally the Flash development environment. It's not yet in general release, so I admittedly haven't played with it, but I'm going to be surprised if it's not a bit on the buggy side at least at the start. MonoTouch has been around a few months now and it's still pretty buggy.



Cover of Learning iPhone Programming
Learn more about this topic from Learning iPhone Programming. 

Get the hands-on experience you need to program for the iPhone and iPod Touch. With this easy-to-follow guide, you'll build several sample applications by learning how to use Xcode tools, the Objective-C programming language, and the core frameworks. Before you know it, you'll not only have the skills to develop your own apps, you'll know how to sail through the process of submitting apps to the iTunes App Store.

Learn More Read Now on Safari

0
  TMNT's Photo
Posted Mar 24 2010 09:08 AM

For Java developers, there is also iSpectrum by FlexyCore which lets you write your Java code and debug in Eclipse to finally produce a native iPhone application. (free for open source apps)(site)
0
  Alasdair Allan's Photo
Posted Apr 13 2010 01:20 AM

After the recent SDK 4.0 announcement, and the (somewhat controversial and widely publicised) introduction of clause 3.3.1 which says,

3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or Javascript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

the answer to this question is now, "probably not". The people working on frameworks like PhoneGap and Unity3D at least currently believe that they'll be okay, but are generally taking a wait and see approach.

However alternative native development platforms, such as MonoTouch or Flash CS5 are probably banned. While the MonoTouch team be still be optimistic, I very much doubt that Flash-based applications will now be possible.

Cover of Learning iPhone Programming
Learn more about this topic from Learning iPhone Programming. 

Get the hands-on experience you need to program for the iPhone and iPod Touch. With this easy-to-follow guide, you'll build several sample applications by learning how to use Xcode tools, the Objective-C programming language, and the core frameworks. Before you know it, you'll not only have the skills to develop your own apps, you'll know how to sail through the process of submitting apps to the iTunes App Store.

Learn More Read Now on Safari

 : Apr 15 2010 11:13 AM
The whole section 3.3.1 fiasco seems a little underhanded to me. Regardless of what their reasoning is, I think they should have announced their intentions long ago. Reminds me of a bait-and-switch scam.