我的應用程序在我的服務器上訪問一個簡單的php文件,它執行簡單回聲「YES」;用於測試目的。我嘗試將echo的內容放入如下的NSString對象中,但我的字符串總是返回(null)。怎麼了?爲什麼不是-stringWithContentsOfURL返回我的PHP回聲?
NSString *theString = [NSString stringWithContentsOfURL:aURLThatEchos];
NSLog(@"Value is: %@", theString);
//Outputs: Value is: (null)