Re: [Newbie] Ampersands in NSURL
Re: [Newbie] Ampersands in NSURL
- Subject: Re: [Newbie] Ampersands in NSURL
- From: Joseph Feld <email@hidden>
- Date: Sun, 22 Sep 2002 09:53:43 -0400
Thanks, Jeremy! OK, this was too weird. It works for me too if I put my
stringWithFormat in the URLWithString method, but it didn't if I constructed
an NSString beforehand and passed that to URLWithString??? Is this an
encoding conflict perhaps? Anyhow, thanks again.
Joe
on 9/22/02 8:25 AM, Jeremy Dronfield at email@hidden wrote:
>
Difficult to answer, since you don't specify what headers you want. You
>
can add a Cc, subject and some message text like so:
>
>
NSURL *url=[NSURL
>
URLWithString:@"mailto:email@hidden?cc=email@hidden&subject=
>
My Subject Text&body=Message text"];
>
[[NSWorkspace sharedWorkspace] openURL:url];
>
>
... which gives the following headers:
>
>
> To: email@hidden
>
> Cc: email@hidden
>
> Subject: My Subject Text
>
>
>
> Message text
>
>
If all you want is to get ampersands into your headers, & works just
>
fine OMM, like so:
>
>
NSURL *url=[NSURL
>
URLWithString:@"mailto:email@hidden?cc=email@hidden&subject=
>
My Subject & Subject2Text&body=Message text"];
>
[[NSWorkspace sharedWorkspace] openURL:url];
>
>
... which produces headers:
>
>
> To: email@hidden
>
> Cc: email@hidden
>
> Subject: My Subject & Subject2Text
>
>
>
> Message text
>
>
-Jeremy
--
Joseph Feld
email@hidden
"You have the right to bear arms and the right to arm bears...whatever the
hell you wanna do."--Robin Williams
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.