Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kerryf88

macrumors newbie
Original poster
Feb 1, 2015
1
0
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.
https://www.ocf.berkeley.edu/~msdosx/labs/01_chatbot.html
 
Last edited:
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.