Domanda

I'm simply looking for an online objective-c compiler. At the moment I have only found ideone.com but it shows errors for any Foundation (e.g NSObject) or UIKit (e.g UIView) classes.

Is there an online compiler for objective-c that can handle Foundation and UIKit classes? Failing that, how might I go about doing this myself on my own server?


EDIT:

As it seems there is no existing online compiler. I'm now asking for a how to guide to build my own online objective-c compiler on a server.

It needs to be able to take a file of code, compile it and output any errors and warnings. It must also be able to handle Foundation and UIKit classes by having access to the necessary frameworks.

I don't know any web-development languages so as much help as possible would be great!

È stato utile?

Soluzione

This question is interesting, but covers really a pretty broad ground. First step is to hone in on exactly what you're trying to create:

  • Is this something you want to hack together for your own use, or something you'd try to productize for others? The latter will of course have all sorts of concerns and requirements that the former probably doesn't.
  • Do you want the service to be like "online Xcode", able to manage a "project" of files and let you test out changes to individual ones? Or are you really just looking to paste a flat bunch of text (a .m file?) into a form and have the service compile it for you and show you the output?

Assuming you want something pretty rudimentary to start with (a form that can compile Obj-C but have Foundation and UIKit available to the compiler), you'd basically:

  • Have a web front end (PHP could be pretty simply used for this) that would show a form and POST the submission of the text of the form.
  • PHP takes the string of code, generates a temporary .m file on the server disk
  • PHP shells out to gcc, using the same build command as, say, a standard empty Xcode project. You'd need to take all the iOS SDK stuff and put it on your server so GCC could access it.
  • Take the gcc output and inject it into the response page.

How to do the PHP, and how to get the gcc stuff right are a little beyond the scope of this question, and depend on how comfortable you already are with the individual components. (As a commenter pointed out, it's worth being a little careful around any agreements you may have in place around usage of the iOS SDK materials, in particular if anyone besides yourself can use your service.)

Altri suggerimenti

http://ideone.com/ http://www.compileonline.com/compile_objective-c_online.php or https://compilr.com/ (note : compilr is not free) the website has a objective c compiler. it is not good just test is not problem

click new code > choose objective-c > write your codes and click submit button.

the problem is that many ads in there but it is not important :))

warning if you do not choose private,your code seems on the website

enter image description here enter image description here

I know it's not really a full-fledged "web service", but you could use a web-based SSH client (or an app for whatever platform you're using) to SSH in to your mac back home and run clang/gcc from the command line, as well as vim or whatever command line text editor you choose. That's what I tended to do when I forgot to throw my CS projects onto dropbox and needed access from campus.

What is your goal? To be able to test code snippets?

It's not online and it's not free, but you might check out CodeRunner. It's available through the Mac App Store, and it's like $5 or something. Basically, you can test code snippets in a variety of languages, including Objective-C. (I have no connection whatsoever to CodeRunner, by the way.)

If you are looking for Xcode alternatives to build iOS apps, I don't think you'll find any.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top