Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6572331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:59:31+00:00 2026-05-25T14:59:31+00:00

Alright, I have a rather odd question here. I feel much more comfortable writing

  • 0

Alright, I have a rather odd question here. I feel much more comfortable writing code in Objective-C over any other language. I recently had to do some server-side programming, which required me to learn PHP. It works, yeah, but for fun I want to achieve the same thing through Objective-C. So, I created a binary using Xcode’s Foundation preset. Here’s most of the binary:

#import <Foundation/Foundation.h>
#import "JSONKit.h"

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    NSString *theURL = [NSString stringWithFormat:@"http://blahblahblah.com/blah"];
    NSError *err = nil;
    NSURLResponse* response = nil;
    NSMutableURLRequest* request = [[[NSMutableURLRequest alloc] init] autorelease];
    NSURL*URL = [NSURL URLWithString:theURL];
    [request setURL:URL];
    [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
    [request setTimeoutInterval:30];
    NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
    NSDictionary *someData = [data objectFromJSONData];
    NSString *someString = [[someData objectForKey:@"foo"]objectForKey:@"bar"];
    //do something

    [pool drain];
    return 0;
} 

Quite basic code. It simply downloads some stuff from my server and I parse the JSON result and get a string that I want to use. So, my question is – how can I run this on my Linux-based server? I know it’s possible, maybe using GNUStep (or cocotron?), which I don’t know how to use. Anyone have ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:59:31+00:00Added an answer on May 25, 2026 at 2:59 pm

    Well,
    I suggest the same thing as the @lacqui.. Use CGI to run your program.. and here’s the steps ..

    (Side note: using CGI is deprecated as it starts a process each time a request is coming to the server (modern servers/web containers initiate a new thread (vs process).)

    So, let’s Start:

    • The input at hand is a program written in Objectiv-c
    • The output is a CGI script(program or whatever they name it) that
      will run inside some http server.

    First, let me ask you, What’s the target platform to deploy your application?

    • If target deployment platform is a Mac then you will have to get the binary out of xcode ( I think it would be in a .dmg format) and find some where how to run a .dmg as a CGI program inside a web server ( I am not sure if apache runs under Mac or not)

    • But If it is Windows or Linux:

      1. You will need to compile your application using GNUstep (I know nothing about portability from Xcode to GNUstep) You will need a GNUstep. Steps to install GNUstep either for Windows or Linux is trivial.
      2. Once Installing GNUstep, you will have to compile your application again using it, refer to the same two links above to know how to compile your application.
      3. The issue here is, AFAIK, GNUstep don’t fully support Objc-2, so possibilities that the compilation will fail cause of usage of JSONKit.h is high. If your program compiles successfully, then you are almost done.
      4. Suppose your program compiles, And you now have the binary program.. You will need to deploy it in some HTTP server that have CGI enabled. You can follow my blogpost here to know how to deploy a binary program written in C into some small http server called mini-httpd on Linux (it should apply to any binary program regardless of its source language).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright so I have recently made the decision to put every string in my
Alright. I have several queries <?php // Make a MySQL Connection mysql_connect(mm.hostname.net, user, pass)
I've written a multi-project .vstemplate file, which works alright, except that the projects have
Alright, so I'm writing this program that essentially batch runs other java programs for
I have class A with its inner class defined A1 and class B with
Alright, i'm making a small game, and I need to limit my FPS, because,
I have a parent-/child relationship of folders, which looks like this: A folder can
UPDATE: I have updated my HTML. Now it works in all browsers except IE7.
tl;dr: I want a high-level introduction to Rails, which covers what I need to
I'm trying to create a separator line in my android view. The setup I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.