• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Public API method naming for NSString * / const char * parameters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Public API method naming for NSString * / const char * parameters


  • Subject: Re: Public API method naming for NSString * / const char * parameters
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 03 Mar 2014 08:18:29 -0800

On Mar 3, 2014, at 7:19 AM, Daniel DeCovnick <email@hidden> wrote:

> Are these selectors bound to library functions that must take char *’s and you can’t afford the overhead of a second method dispatch or function call

The OP is working with Mono, a C# runtime, so I’m sure the glue to it takes C strings.

The overhead of using NSString would be greater than just a method dispatch. Converting an NSString to a UTF-8 C string will often require allocating memory, depending on the internal representation the NSString is using and whether it contains non-ASCII characters. (NSStrings are internally stored as either UTF-16 or MacRoman, not UTF-8.)

—Jens
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Public API method naming for NSString * / const char * parameters
      • From: Daniel DeCovnick <email@hidden>
References: 
 >Public API method naming for NSString * / const char * parameters (From: "email@hidden" <email@hidden>)
 >Re: Public API method naming for NSString * / const char * parameters (From: Daniel DeCovnick <email@hidden>)

  • Prev by Date: Re: NSOperation Dispatch Thread Soft Limit
  • Next by Date: Re: NSOperation Dispatch Thread Soft Limit
  • Previous by thread: Re: Public API method naming for NSString * / const char * parameters
  • Next by thread: Re: Public API method naming for NSString * / const char * parameters
  • Index(es):
    • Date
    • Thread