Can't link on iPhone cuz core services framework not available?

Discussion in 'iOS Programming' started by beachdog, Aug 13, 2008.

  1. beachdog macrumors member

    Aug 10, 2008
    Uh-oh, I hope I didn't make a boo-boo here...I've built an app that I have been testing on the simulator which uses NSStream and NSHost to do some sockets programming. I had to add in the core services framework to my project in order to build on the simulator, but now when I try to build and deploy to my device it fails with an error "framework not found CoreServices".

    Can I not use NSStream etc on the iPhone? Or is there some other way I should set up the project to do so? If I can't use NSStream what is the alternative suggested way to do tcp streams socket (I need something lower level than NSUrl)?
  2. kainjow Moderator emeritus


    Jun 15, 2000
    NSHost isn't available on the iPhone. NSStream is a part of Foundation so I'm not sure why you should need CoreServices.
  3. beachdog thread starter macrumors member

    Aug 10, 2008
    You're right -- it looks like I was mistaken about this -- I took CoreServices framework out of my project and was able to build and run it on the device as well as the simulator. However, something strange -- when I build I get two warnings for the lines below:

    	NSHost* host = [NSHost hostWithAddress:serverAddress];
    	if( host ) {
    		[NSStream getStreamsToHost:host 
                         outputStream:&oStream] ;
    The warnings say 'no hostWithAddress method found' and 'no getStreamsToHost' method found. These warnings only display when I build for the device, not when I build for the simulator. Yet the app works fine on the device, and those lines do in fact establish a socket connection to my server. Is this anything to worry about?

Share This Page