Re: Creating NSURL from Apple Event string
Re: Creating NSURL from Apple Event string
- Subject: Re: Creating NSURL from Apple Event string
- From: "Shawn Erickson" <email@hidden>
- Date: Tue, 10 Oct 2006 12:21:33 -0700
On 10/10/06, a.d. jensen <email@hidden> wrote:
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:
Can you outline how you construct the NSString you feed into
URLWithString:? Also how you convert from a Str255 to a C string?
It sure sounds like the problem exists in that area of things.
-Shawn
_______________________________________________
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