Search code examples
iphoneobjective-ciosxcodebonjour

Bonjour Programming on the iPhone


i am just try to implement the tutorial from here but i have problem in -(void)netServiceDidResolveAddress:(NSNetService *)service {} this method enter image description here how can i remove these error plz help me out.

Thanks in advance.


Solution

  • Have you added

    #include <arpa/inet.h>
    #include <netinet/in.h>
    

    struct sockaddr_in is declared in netinet/in.h

    struct sockaddr_in {
       u_char   sin_len;
       u_char   sin_family;
       u_short  sin_port;
       struct   in_addr sin_addr;
       char sin_zero[8];
    };
    

    and inet_ntoa as

    char    *inet_ntoa __P((struct in_addr)); /* in libkern */