views:

392

answers:

5

Now that monotouch is banned, I was wondering if there is a way to translate C# (or some other language) into Objective-C? I won't mind using Apple's API as long as I don't have to declare my variables in 3-4 stages (ivar-property-synthesize-dealloc). All I want is a less wordy language, to concentrate on my intent and not on the compiler syntax.

+4  A: 

You could always define your own meta language for objects, write your intended meaning, parse that file, and paste the newly manufactured code into XCode.

And if you're really dead-set against ObjC and XCode, Apple has given you your ultimatum: use it or leave.

Chris
Unfortunately, I think this is the right answer, Apple has drawn the line in the sand.
Andy White
yeah, I have to use it. I know, it's business, nothing personal. I just want to see if I can minimise my suffering ;)the meta data and paste is a hacky approach, I was thinking about writing in C#, then the compiler converting it to some "intermediate" language (C or ObjC) and then let xcode compile it in background...
Ali Shafai
That's exactly what I'm prescribing (if you're refusing to hand-roll Objective-C). Write a small compiler to convert from your format of choice into Objective-C. Then just copy/paste that into XCode - I don't see how that's less hacky then what you recommend.
Chris
+3  A: 

If it turns out the way people are suggesting it will turn out, then the answer to your question doesn't actually solve your problem.

The SDK agreement make specific mention to the 'originality' of the Objective-C (and other languages). Translating from C# to Objective-C breaches this requirement that applications be originally written in Objective-C.

Secondly, Monotouch already supports full AOT compilation.

Michael Shimmins
+2  A: 

Translating would be against Apples policy because your code must be originally coded in C, Obj -C, C++.

Coming from originally learning Java its really not that hard. Is the declaration of variables in multiple places really your main objection? Its easy to do and gives you tight control over your program. It is also suspected that iPhone OS 4 needs native code to be able to multitask properly. It makes sense as well otherwise they would of amended the current licence agreement if they wanted to stop Adobe.

Rudiger
monotouch produces "native code" and can be multi task "friendly", just needs to follow rules. I have done ObjectiveC and have 7-8 apps in appstore, I have re-written all of them in C# (to be honest on the bus getting to the office and going back home), so C# is much easier for me. what doesn't make sense to me is Apple's approach of my way or the highway. if they had a set of rules your app needs to follow to be acceptable, that was fine, but with what language I write my app is a bit too much. again, I understand, it's their platform and they can do what they please.
Ali Shafai
If monotouch does do everything absolutely correctly what would Apple know what language you used, you don't submit your source code to them(unless this has changed). The only reason they would know is if the OS can't control it properly and is producing errors, in which case Monotouch aint compiling it properly and this would affect the user. And if your worried about breaking the agreement by using monotouch your going to do it anyway by trying to translate into Obj-C so that shouldn't be the problem.
Rudiger
@Rudiger: monotouch does do everything absolutely correctly, the binary it produces however has some "markers" and "signatures" that makes it obvious to Apple that the binary is compiles with monotouch. there are many apps on appstore written in objective c which are great and there are lots of crap ones. many of them crash, many don't. many leak memory, many don't. what makes an app great is not the tool, is the developer. by banning certain tools no one achieves better quality.
Ali Shafai
Monotouch might be great, but there are tools out there that create crap. If Apple can then reject apps based on quality then there is a grey line which people will be even more annoyed about. If there is a functional problem with some tools then how bad would it look if Apple says Monotouch is allowed but Adobe isn't, it would look like a personal attack. So what can they do? Ban all, no discrimination no grey areas.
Rudiger
@Rudiger: yeah, there are guys out there who kill people with knives, do we ban all types of knives? Quality is something measurable. you can say: the app should not take more than x amount of seconds to load (which already is enforced) or the app should have the native look and feel (by using native controls only) or the app should be responsive in such and such way. but saying in what language it is written remind me of Taliban. again, don't get me wrong, it's Apple's party and if you wanna go, dress like they want, but rationality is something we as software developers should value...
Ali Shafai
Quality is something that is based on perspective, one persons quality app is another persons crap. Load time is measurable. There are many apps that have non iPhone look and feel. But for Apple to reject an App that isn't in their minds good is worse for developers than restricting the development tools.
Rudiger
+7  A: 

You should pause to see what actually happens instead of assuming Monotouch is banned.

Or, learn Objective-C. It's good for the mind to learn a new language anyway. And the frameworks will make more sense to you.

Kendall Helmstetter Gelner
+2  A: 

This is something I wrote last year and may help you with the transition - Objective C by example for a C# developer, assuming Monotouch is actually forbidden.

Chris S