• 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: Include an executable without hard coding the path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Include an executable without hard coding the path


  • Subject: Re: Include an executable without hard coding the path
  • From: Rick Schmidt <email@hidden>
  • Date: Sat, 18 Jul 2009 22:56:43 -0500

I think I get it now,  I'll try to implement that. Thanks a lot everyone.  

Rick

On Sat, Jul 18, 2009 at 10:36 PM, Quincey Morris <email@hidden> wrote:
On Jul 18, 2009, at 20:00, Rick Schmidt wrote:

So do be clear the concern is having a the chunk of memory that is holding the string being written too and overflowing?

It's mostly about whether the memory block holding the C-string will get deallocated before you or the library is finished with it.

Perhaps the simplest way to deal with it is to transform the problem into C-land where you have more familiarity, along this line (not tested):

       myNSString* = ...
       const char * myUTF8String = [myNSString UTF8String];
       char * myCString = malloc (strlen (myUTF8String) + 1);
       strcpy (myCString, myUTF8String);
       ... pass myCString on to your library routine

Then all you have to worry about is when to 'free (myCString)' at some later time.



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Include an executable without hard coding the path (From: Rick Schmidt <email@hidden>)
 >Re: Include an executable without hard coding the path (From: Scott Ribe <email@hidden>)
 >Re: Include an executable without hard coding the path (From: Rick Schmidt <email@hidden>)
 >Re: Include an executable without hard coding the path (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Include an executable without hard coding the path
  • Next by Date: Re: Distribution Cert/Prov Problems, "A valid signing identity matching this profile could not be found in your keychain"
  • Previous by thread: Re: Include an executable without hard coding the path
  • Next by thread: Custom OBJROOT and SYMROOT and Multiple Instances of .pbxindex Bundles
  • Index(es):
    • Date
    • Thread