Problem about using Asyncsocket on Iphone (related to the "this is the message" topic)

Hi,

I am trying to use Drew McCormack's code to make my IPhone act as a server discussing with any available client (PC, Mac, Other IPhone, etc...).

This is the moment when I should say that I am a new developer on Apple devices... I am thus new to Obj-C, X-Code, and all Apple frameworks (My main skills are C/C++, OpenGL, MatlAb, Visual C++, etc..). This means that I may (and will indeed) say a few obviously stupid things and hope You will remember the previous point :)

Then : Though Drew's Code was described as an opportunity to do such conversation between IPhone and Mac, this code sounded like it was written for MacOs only. Ie when I change the building settings so that it will compile for IPhone Simulator (2.2 or older), It failed.

A few reasons for that... some I identified and fixed:
- AppKit is not designed for IPhone. I then remove AppKit framework and added UIKit one
- Cocoa.h was not found... I remove it and added UIKit.h instead (I also had to replace a few NSxxx classes with UIxxx equivalent classes)
- A few "unreferenced symbols" encountered were resolved adding CFNETWORK, COREFOUNDATION and CORELOCATION frameworks

And the one I am still stucked with :
Undefined symbols:
"_objc_setProperty", referenced from:
-[ServerController setMessageBroker:] in ServerController.o
-[ServerController setConnectionSocket:] in ServerController.o
-[ServerController setListeningSocket:] in ServerController.o
".objc_class_name_NSAutoreleasePool", referenced from:
literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in AsyncSocket.o
"_objc_sync_enter", referenced from:
-[AsyncSocket acceptOnAddress:port:error:] in AsyncSocket.o
... and many others

Then : I was surely worong, and am even not sure I should have used the same project... but since I don't really understand the problem, and don't know how to find those unreferenced reference, I'd like to understand it before trying to redo things from scratch.

Thank you in advance.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Asyncsocket on iPhone

The Mac and iPhone have very different programming interfaces. You can reuse MTMessage and MTMessageBroker classes, and AsyncSocket, on the iPhone, but you will have to completely rewrite the rest of the app. Your best bet is to start with a new iPhone project in Xcode, and drag in the classes above to that project. Then you should develop the rest of the code. Some may be similar to the Mac app, but most will have to be rewritten.

Drew

---------------------------
Drew McCormack
http://www.maccoremac.com
http://www.macanics.net
http://www.macresearch.org

Ok, I thought IPhone and

Ok,

I thought IPhone and MacOs was a little closer to each other, but it sounds like I mistook :)
Then I have started following your instructions, and it looks more like what I expected. Thanks a lot for your response.

-------
42 etc....