iPhone アプリで HTTP ステータス コードを確認して評価する必要があります。サイトに正常に接続する NSURLRequest オブジェクトと NSURLConnection があります。
// create the request
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
// create the connection with the request
// and start loading the data
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
// Create the NSMutableData that will hold
// the received data
// receivedData is declared as a method instance elsewhere
receivedData=[[NSMutableData data] retain];
} else {
// inform the user that the download could not be made
}
しかし、(私が見る限り) HTTP ステータス コードへのアクセスについては何も述べていません。
サイトへの接続を作成し、その接続の HTTP ステータス コードを確認する方法は?