• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[NSString stringWithContentsOfURL:] question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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.

  • Follow-Ups:
    • Re: [NSString stringWithContentsOfURL:] question
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: NSTimer and call-by-reference
  • Next by Date: Re: NSTableView modifications
  • Previous by thread: Re: NSTimer and call-by-reference
  • Next by thread: Re: [NSString stringWithContentsOfURL:] question
  • Index(es):
    • Date
    • Thread