title: Get time as a string from PHP does not work
body: <p>because i don't want to use the NSDATE function of Xcode, i tried to override it with a php script...i found the solution here but it does not work or i can't get it to work.</p>
  
  <p>this is the code:</p>
  
  <pre><code> - (NSDate *) CurrentDate
   {
       if ([self hasInternetConnectivity]) // this tests Internet connectivity based off Apple's Reachability sample code
       { 
           NSURL * scriptUrl = [NSURL URLWithString: @"http://&lt;yoursite&gt;.com/&lt;the 2 line php script&gt;.php"];
           NSData * data = [NSData dataWithContentsOfURL: scriptUrl];
  
           if (data! = nil) {
                NSString * tempString = [NSString stringWithUTF8String: [data bytes]];
                NSDate * currDate = [NSDate dateWithTimeIntervalSince1970: [tempString doubleValue]];
                NSLog (@"String returned from the site is:% @ and date is:% @", tempString, [currDate description]);
                return currDate;
           } else {
                NSLog (@ "nsdata download failed");
                return [NSDate date];
           }
      } else {
          NSLog (@ "InternetConnectivity failed");
          return [NSDate date];
      }
  }
  </code></pre>
  
  <p>Whatever i do it returns errors as in hasInternetConnectivity does not exist in @interface etc..</p>
  
  <p>i just pasted the code into the NAME.m file but it does not want to work..</p>
  
  <p>what i am trying is to get the requested date (php time should return something like 20:10:40 ) in a text field.</p>
  
  <p>its just a string...when someone pushes the button it should get the server time and put it in the text field...</p>
  
  <p>what am i doing wrong ?</p>