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

    Joined:
    Aug 10, 2008
    #1
    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

    kainjow

    Joined:
    Jun 15, 2000
    #2
    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

    Joined:
    Aug 10, 2008
    #3
    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:

    Code:
    	NSHost* host = [NSHost hostWithAddress:serverAddress];
    	if( host ) {
    		[NSStream getStreamsToHost:host 
                         port:server_port 
                         inputStream:&iStream 
                         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