[NSString stringWithContentsOfURL:] question
[NSString stringWithContentsOfURL:] question
- Subject: [NSString stringWithContentsOfURL:] question
- From: Marc Weil <email@hidden>
- Date: Thu, 13 Feb 2003 09:11:34 -0500
Hello,
I have this line of code to retrieve the result of a Perl script on my web
server:
NSString *serverSideList = [NSString stringWithContentsOfURL:[NSURL
URLWithString:@"
http://www.northsoftproductions.com/cgi-bin/access.cgi"]];
The Perl script simply returns the contents of a text file that is also on
the server (it actually "prints" the result back). Of course, this value
that is returned is not an NSString, but rather is plain text.
Whenever this line of code is executed, serverSideList becomes "(invalid)"
when in gdb, and it's memory address becomes 0x0. I am assuming this is
happening because -stringWithContentsOfURL is probably expecting an NSString
object, not a normal string (not even a cstring, I don't believe, just plain
old text in a .txt file).
My question is: how do I call this Perl script from my Cocoa program and get
the result into an NSString?
TIA,
Marc Weil
--
"Software exists to solve your problems. We exist to make the problems."
Microsoft
_______________________________________________
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.