Re: NSString to char[]
Re: NSString to char[]
- Subject: Re: NSString to char[]
- From: Clark Cox <email@hidden>
- Date: Fri, 29 Jul 2005 09:34:21 -0400
2005/7/24, Jerry Brace <email@hidden>:
> Hey Guys,
>
> I found a solution that works - let me know what you think:
>
> NSMutableString * path = [thisBundle pathForResource:@"wakein"
> ofType:@""];
>
> unsigned int lengthOfMessage = [path length];
> char sysctlPath[lengthOfMessage + 1];
> strcpy(sysctlPath, [path UTF8String]);
Bad idea. (strlen([path UTF8String])) does not always equal ([path
length]). Try this instead:
const char *sysctlPath = [path fileSystemRepresentation];
--
Clark S. Cox III
email@hidden
http://clarkcox3.livejournal.com/
http://homepage.mac.com/clarkcox3/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden