views:

117

answers:

2

First of all, is this possible?

If so:

What challenges would I encounter in making an XCode imitation for iPhone/iPod development for Windows or Linux?

I was thinking about using gcc as the actual compiler for the objective-c and (VB).NET for the IDE. Will that work?

It doesn't need to compile to iPhone OS until it is to be tested on the device or submitted to the app store. Perhaps it will be easier to compile to the local OS format (Windows or Linux) until "prime-time".

Is this concept possible? Comments? Ideas of how to implement?

+1  A: 

If you wanted to support all of UIKit and Cocoa Touch, the problems would be insurmountable. You'd spend 2 years trying to get off the ground and then give up, while everyone else had fun developing apps for the iPhone and iPad and other devices. You would regret even trying it.

But if you wanted to create your own framework for making iPhone apps, built immediately on top of OpenGL, it might be possible. You would create a simulator that renders to an OpenGL view, and the final app would also render everything in an OpenGL view, touching none of UIKit. You would use pure C, or some robust cross-platform language like Lua, compiled or even interpreted. Incidentally, that's more or less how the Corona framework does it: built on top of OpenGL, touches little of the iPhone SDK, uses compiled Lua. They developed their own simulator, which only runs on OSX, but could probably relatively easily be ported to Linux.

You could even use Objective-C as the language, and make available a carefully chosen subset of the Cocoa API's by using (the iPhone compatible parts of) GNUstep Base. Then users could use standard classes like NSString.

Still, all of this is mostly interesting as a thought experiment, unless you got a team together to work on this as an Open Source project. It's harder than you think. Your simulator wouldn't be able to emulate the way that memory warnings are generated on the iPhone, for example.

If someone wants to develop iPhone apps on Linux, it makes more sense to just write the whole app in C/C++ using OpenGL, and then basically just smack that code onto a vanilla iPhone OpenGL project. That's the fastest path. The next possibility would be to use another language, which is also not too hard. But an "iPhone IDE" on top of that would be little more than putting an iPhone-like frame around the OpenGL view in Linux.

Felixyz
A thorough answer, +1. I'm not sure Linux is the target. What about Windows? I use all 3 OSs in their own place, but Windows users don't need to be left out. Also, frameworks are just built off of objective c anyways, so what's so hard about porting.
Moshe
All I said applies equally to Windows. You can't link to Apple's frameworks (dynamic libraries) on other platforms, and you don't have the source code so you can't compile them on other platforms (even if you were able to adapt them to the other platforms, which would take several years). Creating the frameworks from scratch would be tantamount to duplicating the GNUstep effort, which has been ongoing for some 15 years. But you could of course create your own Objective-C libraries for cross-platform use. And as I said you could even use selected parts of GNUstep base (also on Windows).
Felixyz
+1  A: 

Actually, Felixyz touched on something your should take a look at. See: http://www.gnustep.org/ . They have binaries for just about every variant of *nix, OS X, and windows. The site claims "GNUstep seeks to be source code compatible with Cocoa and OpenStep, it can thus be used to develop and build cross-platform applications between Macintosh (Cocoa), Unix and Windows." It would be a good jumping off point for such a project,

I doubt all OSX's functionality is covered by GNUStep, but it's a start.

I'd imagine to develop iPhone/iPod apps on an alternate platform, you'd need to get Apple's includes (Legality is likely to be an issue), and apply all their toolchain patches, plus a million other things I'm probably overlooking.

What would be a better project is implementing the missing functions in GNUStep to support OSX apps seamlessly under the host platform. Maybe then you could run xcode native on your desired OS.

hyperkinetic
@hyperkinetic: GNUstep has (almost?) full support for 10.4 now, and some of 10.6. It also just got a new runtime to support properties and more. However, "implementing the missing functions" is not a small project, as I pointed out before, but contributing in that direction would probably mean joining the GNUstep effort. You won't be able to run Mac binaries under another os though, without some kind of virtualization.
Felixyz