• 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
Re: php call from Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: php call from Cocoa


  • Subject: Re: php call from Cocoa
  • From: j o a r <email@hidden>
  • Date: Wed, 21 Sep 2005 14:28:32 +0200


On 21 sep 2005, at 14.20, Lorenzo wrote:

I have to call a php script on my web server
    http://www.dom.com/get.hph
it returns a string. Actually I call

    phpPath = [NSURL URLWithString:@"http://www.dom.com/get.hph";];
    response = [NSString stringWithContentsOfURL:phpPath
                encoding:NSUTF8StringEncoding error:&error];

It works sometimes. Many times it returns nil (but the error code is still
zero). We have already spoken here that instead of using
stringWithContentsOfURL it is better to use NSURLConnection, but before I
implement it, I would like to know whether there is a better way.

Could it be that it returns *nil* because the string is not in UTF8 format? Try with Latin1 and see how that works. You would get better feedback using NSURLConnection.


Also NSURLConnection is asynchronous while I need immediate feedback.

What do you mean with "immediate"? Making it synchronous probably doesn't make it any faster.


j o a r


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: php call from Cocoa
      • From: Lorenzo <email@hidden>
References: 
 >php call from Cocoa (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: NSDateFormatter time zone not "sticking"? [SOLVED]
  • Next by Date: Re: Mysterious warning (initialization from distinct Objective-C type)
  • Previous by thread: php call from Cocoa
  • Next by thread: Re: php call from Cocoa
  • Index(es):
    • Date
    • Thread