views:

806

answers:

6

Greeting, I'm a C# programmer guy. I'm planning to start developing app for iphone but I'm not sure if I should use C# under MonoTouch or just use the native language for iphone OS Objective C.

Is there a different to program for iphone app using C# or Objective C?

Is there limitation using C# to program app for iphone or it can do as much as Objective C can do to develop iphone app?

A: 

I haven't used mono touch, but I think I would recommend against it. If you know any flavor of C then I think you will get a grasp of objective c with in weeks. And I am pretty sure Apple wont let your app to AppStore with C#.

Asad Khan
That's strange, because I've had 3 accepted in the past week, and 4 other people have as well
Chris S
Yes, but with the new terms and conditions Apple are actively banning apps not written in C/++ or Obj-C.
Gary Willoughby
These were accepted under the new terms @Gary
Chris S
Yes i understand that but at any time jobs may pull the plug, as he has on many of apps that have been in the store for months. Apple are tightening up on apps not written in C (of whatever flavour). They could be left in the store forever, but there is now a deffinate risk they mat be removed at later stage.
Gary Willoughby
A: 

With Application Developed In C# ( Other than C/C++/Objective C) chances are very strong that application will be rejected by APPLE... So i would say... start Develop in Objective C only...

also Mono Touch Has some limitation as compare to cocoa...(Some of the Cocoa API will be needed for certain features... which can not be implemented in Mono touch...)

mihirpmehta
Apple may only enforce the rule with Flash apps, but maybe they will reject C#/MonoTouch apps. It's not clear at this point, but there are currently C# apps on the store that haven't been retroactively rejected but they might some day....
Jared Updike
yes that's why... even they might not rejected but why to take chance...? when we have richer API of cocoa as compare to mono touch (as of now...)
mihirpmehta
Wrong, and also wrong. Anything Cocoa can do, Monotouch can do. 4 MT apps have already made it past the app review process. And given the huge C# community here it would make a lot of sense to use C#
Chris S
Oops...we've a biased C# developer here...
mihirpmehta
http://monotouch.net/Documentation/Limitations
mihirpmehta
deleted.......?
mihirpmehta
The link you gave is for CLR limitations (no Reflection.Emit or virtual generic methods). It has no limitations on the Cocoa API and really binds almost exactly 1-1. Also Monotouch apps have been accepted over the past week so it's not certain. As I said in my post the Monotouch license costs $400 which is probably the main factor
Chris S
+6  A: 

MonoTouch wraps most but not all of the iPhone SDK. So, yes there are things you can't do (yet), but they're relatively few and far between.

Many .Net folks find that they are more productive (at least initially) using MonoTouch, since they can leverage their existing skills. On the other hand, there's nothing like working in the native language of the land, it just takes a little longer. You will have to learn some Objective-C since most documentation out there in the world uses it (and/or C-level CoreFoundation APIs). Objective-C's dynamic nature will feel foreign at first, but you may find it quite liberating once you grok it fully. Having used many languages in my career, I find Objective-C (and the Cocoa APIs) one of the most pleasant development experiences out there.

Finally, there's the now infamous section 3.3.1 of the Apple iPhone Developer Program license agreement. It states that any app that uses a compatibility library (which MonoTouch most certainly is) is in violation of the agreement. Apple can, at their discretion, reject MonoTouch apps. It appears right now that this clause was directed specifically at Adobe's Flash-to-iPhone compiler. Apple doesn't have to enforce this clause for other development tools such as MonoTouch and it appears that, again at least so far, they've chosen to let MonoTouch apps through. For personal projects, this may be enough. Until Apple makes a clarifying statement regarding MonoTouch, I would regard using it as a significant risk for a commercial project.

Barry Wark
What is the statement "they've chosen to let MonoTouch apps through" based on?
Yar
@yar, several developers have reported that their MonoTouch-based apps were accepted after they accepted the new developer license. It's unclear whether Apple chose not to enforce ß3.3.1 for MonoTouch (my suspicion) or if Apple just hasn't started enforcing it yet.
Barry Wark
@Barry Wark, I thought there's no way -- presently -- for Apple to tell if the app is done with MonoTouch? Is this true (I mean, given current knowledge)?
Yar
@yar I have no idea whether Apple can identify MonoTouch apps. I'm not familiar enough with the MonoTouch AOT compiler to make a useful guess.
Barry Wark
Apple's main target is Adobe and their Flash to iPhone App converter. I think MonoTouch apps should be fine - I can't see how they could detect them easily anyway.
Callum Rogers
@Callum, that is certainly the general consensus, but is definitely *not* Apple's representation.
Barry Wark
@Barry, as of Sept 9, 2010, Apple has relaxed the development tools restriction a bit now: http://www.apple.com/pr/library/2010/09/09statement.html
ShaChris23
+1  A: 

There is some debate over whether Apple will allow this. On the face of it, it seems not:

In the new version of the iPhone Developer Program License Agreement released by Apple today (and which developers must agree to before downloading the 4.0 SDK beta), section 3.3.1 now reads:

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).

From monotouch forums

Topdown
I agree. Until Apple clarifies their stance on MonoTouch, I would consider it's use a serious risk for a commercial project.
Barry Wark
+4  A: 

Here's a Monotouch developer's answer rather than some guess work from people skim reading blogs.

Have you bought the Monotouch license? If not then clearly objective-C would be preferred. If you have bought a license then it makes sense to develop the app in Monotouch because:

  • The domain and business logic can easily be ported for a Windows Mobile 7 app later this year
  • The same is also the case for Monodroid which is coming soon, and the API could easily be ported to Java too.
  • Controllers, Views and the whole Monotouch system bar static void main can be very easily converted to objective-C. The names are all identical but in Pascal case.

As far as apps being accepted - so far Apple have let Monotouch apps through. I'm not saying they won't suddenly say "NO! THOU SHALL USE OBJECTIVE-C" but for them to ban an SO iPhone client on a high profile site like Stackoverflow would be bad PR.

Apple use apps in their demos which break their own SDK (Tap Tap Revolution being one), and 1 in 10 of the appstore best selling games use a health portion of none-objective-C.

Monotouch is a direct mapping to Cocoa and UIKit. You need to have a mac to use the compiler and IDE. As far as I'm aware Flash had no such restrictions and its UI was a lot less strict in terms of forcing the common "widget" set like UINavigationController, UITabViewController, UIAlertView and so on.

Chris S
To be safe i would use Obj-C then you don't run the risk of wasting your time.
Gary Willoughby
If it was rejected the UI part would definitely be waste of time. But the bits for querying could be used later for Winmo and Android
Chris S
+1  A: 

Here's my take: if you have absolutely never seen Obj-C code in your life, it'll take a bit of a time to get used to it. Put it together with the fact that the SDK is totally different and you'll have to learn every single new method, and it'll probably take at least a couple of months for you to become an average obj-c developer if you study hard.

Instead, use MonoTouch and learn the entire SDK using C#. In a couple weeks, you'll feel right at home with all the classes, Interface Builder, etc. You'll be able to develop the app in the same way you would with Obj-C, but in C#. The demo version allows you to use everything, for free.

THEN you decide what to do. Depending on how the whole issue with Apple goes, you may decide to just continue using MonoTouch, or you may decide to learn Obj-C, and basically use all the knowledge you have already gained about the SDK, which will make the transition much easier.

Eduardo Scoz