Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 842803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:01:27+00:00 2026-05-15T06:01:27+00:00

In my iPhone app, I’m publishing a bonjour service and using the following delegate

  • 0

In my iPhone app, I’m publishing a bonjour service and using the following delegate method:

- (void)netServiceDidPublish:(NSNetService *)ns
{
   NSLog(@"Bonjour Service Published: http://%@.%@", [ns name], [ns domain]);
}

The “name” property is returning the device name, “How’s Testing”, which is correct. However, when I use Safari to discover available services the name is “hows-testing” — the service is http://hows-testing.local.:somePortNumber.

Why is the published name different than what is being reported by the NSNetService? How do I display for the actual name of the published service? Assuming that, for some reason, there is no way to get the published name from the object, how do I determine it myself? I understand that it’s based on device name, but what are the substitution rules? Remove apostrophes, replace spaces with dash…anything else? What about special characters?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:01:28+00:00Added an answer on May 15, 2026 at 6:01 am

    I believe that “hows-testing” is the host name of the computer, not the name of the service. Instead, you want to look at the hostName attribute:

    - (void)netServiceDidPublish:(NSNetService *)ns
    {
       NSLog(@"Bonjour Service Published: http://%@", [ns hostName]);
    }
    

    You should probably also examine the port attribute, and include it in the URL, if the port is something other than the default for that protocol (80 for HTTP)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My iPhone app formats an NSDecimalNumber as a currency using setCurrencyCode, however another screen
My iPhone app has the following problem: Freshly installed, when I read out my
In iphone app i am using alertview to check the if textbox values is
My iphone app creates files using the my custom .ops extension. using NSDictionary. Nsdictionary
My iPhone app was rejected last week because of me not following iOS Data
In iPhone App i am using core Plot vertical bar chart. How to Remove
My iPhone app communicates with a RESTful service that provides JSON output. I've been
My iPhone app is using encrypted assets. The decryption key will need to be
my iphone app is using soap web-services. I want to know how it would
My iPhone app is quite simple, however it errors out. My app delegate opens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.