web service in objective c [closed]
Can we write a web service in objective c.Please help me out , i m in confusion
Yes we can! You can just use printf
and CGI to do this. (Like you'd do with Python, Ruby, Perl, PHP, Shell Script, Malbolge, etc…).
Example:
#include <stdio.h>
int main() {
printf("Content-Type: text/html\n\r");
printf("\n\r");
printf("<h1>Hello, world!</h1>");
return 0;
}
Compile using this:
$ clang *.m -isysroot /Developer/SDKs/MacOSX10.7.sdk
$ mv a.out index.cgi
See the documentation of your web server for information on how to enable CGI.
Or you can do it the die-hard way by writing a server in Objective-C. It's not very difficult.
精彩评论