Using Mac apps code for iPhone app

Discussion in 'iOS Programming' started by kerryf88, Feb 1, 2015.

  1. kerryf88, Feb 1, 2015
    Last edited: Feb 1, 2015

    kerryf88 macrumors newbie

    Feb 1, 2015
    I am new to app designing and would like to design a simple chat bot app. I found an open source sample code on the web for such application, however it was written as Mac app and runs on the Mac Terminal. I was wondering if it will work if I import the code into Xcode and choose iPhone app development?

    Edit: this is the framework that I wish to use for iPhone app development, however it is written for Mac.
  2. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    iOS does not provide a user visible console (stdin and stdout), so you will at minimum need to add some sort of UI views and controllers for input and text output to your code port. Other than user IO, many posix and Foundation calls used by unix terminal and OS X apps are supported by iOS, but not those APIs that expect to launch other processes or to access a full (outside a sandbox) file system.
  3. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    I looked at the web page and downloaded the source code. In reality it's very simple. Mostly it does a little string manipulation and prints a few things out into a text view.

    Someone who knows a little bit about iOS development could adapt the sample code he provides and make it work on iOS. Someone who knows nothing about iOS development will probably get tripped up by a lot of little things. If you fall in the second category I suggest that you start with another beginner tutorial that is aimed directly at iOS and then come back to this in a little while.

    If you know what IBOutlet, IBAction, and UITextView are you could do this tutorial. Otherwise find something that will work out of the box.

Share This Page