Re: Include an executable without hard coding the path
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