Re: SFAuthorization KAuthorizationEnvironmentIcon setting not working
Re: SFAuthorization KAuthorizationEnvironmentIcon setting not working
- Subject: Re: SFAuthorization KAuthorizationEnvironmentIcon setting not working
- From: "stephen joseph butler" <email@hidden>
- Date: Thu, 18 Jan 2007 19:02:02 -0600
2007/1/18, David Garcea <email@hidden>:
AuthorizationItem dialogConfiguration[2] = {
{kAuthorizationEnvironmentIcon, [pathToIcon length], (void*) [pathToIcon
UTF8String], 0},
{kAuthorizationEnvironmentPrompt, [prompt length], (void*) [prompt
UTF8String], 0}
};
I don't know if it's causing your problems, but this is most certainly
not the correct way to pass C strings from an NSString. -length
returns the number of characters, which will be less than the UTF8
encoding if the string contains non-7 bit characters. Plus, it's best
to not assume that UTF8 is the filesystem representation. Here's a
better version:
const char *cPathToIcon = [pathToIcon fileSystemRepresentation];
const char *cPrompt = [prompt UTF8String];
AuthorizationItem dialogConfiguration[2] = {
{kAuthorizationEnvironmentIcon, strlen( cPathToIcon ), (void*)cPathToIcon, 0},
{kAuthorizationEnvironmentPrompt, strlen( cPrompt ), (void*)cPrompt, 0}
};
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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