Creating NSURL from Apple Event string
Creating NSURL from Apple Event string
- Subject: Creating NSURL from Apple Event string
- From: "a.d. jensen" <email@hidden>
- Date: Tue, 10 Oct 2006 14:08:34 -0500
I have this really annoying issue that keeps coming up over and over
and I'm at my wits end. Hopefully I can get some help.
I have a Cocoa application that receives a URL in a string in an
Apple Event and opens a web view of the page. I have two different
applications that are sending this Apple Event, one is a Carbon C++
program, the other a Carbon Pascal app (written in FPC, compiled in
xCode.)
The C++ program seems to send the string fine, and the Cocoa app
opens the page fine.
The Pascal program, on the other hand, just seems to send over bad
strings (which I've converted from Pascal Str255 to zero-terminated C
strings). They SEEM to be valid, but when I run this:
NSURL *myURL = [NSURL URLWithString: urlString];
I get a nil myURL. Documentation says it will be nil if "urlString"
is invalid. In the debugger, it sure LOOKS valid, and if I replace
that line with:
NSURL *myURL = [NSURL URLWithString: @"http://www.apple.com"];
it works fine.
How do I figure out what's wrong with "http://www.apple.com" in a
NSString, that isn't wrong when I use @"http://www.apple.com" directly?
Thanks!
dale
--
email@hidden http://kandsmil.blogspot.com
Only a fool turns away from an angel,
Vision in white steps through the door,
Holds out her hand, I say 'No I'm not ready'
I open my eyes and let the dream fade away.
-- echolyn, "on any given nite"
_______________________________________________
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