私の英語のために申し訳ありません^^ 私は通貨のためにgoogle converter toolから結果を得る方法を知っています。例えば、http://www.google.com/finance/converter?a=1&from=USD&to=GBPにあります。 (それが空であるように、それはある)Iphone dev:Google通貨コンバータからどのように結果を得ることができますか?
-(IBAction)getResponse:(id) sender{
NSString *myURLString = @"http://www.google.com/finance/converter?a=1&from=USD&to=GBP";
NSURL *myURL = [NSURL URLWithString: myURLString];
NSData *data = [NSData alloc];
data=[NSData dataWithContentsOfURL:myURL];
if(data!=nil && data != ""){
NSString *response = [[[NSString alloc] initWithData:data]]
[label setText: response];
}
else [label setText:@"not working"];
}
をしかし、私は私のボタンをクリックすると、ラベルはテキストを持っていません。
私はすでにそのような何かを試してみました。 何か間違っていますか? 私は何をしたいのですか? お返事ありがとうございます。 Olivier。
これは完全なHTMLページを返します。このページでは、googleコンバーターAPIの使用例をご覧ください:http://oohhyeah.blogspot.com/2009/01/google-currency-conversion-api.html – rckoenes
あなたの返信をNSに返信してください。それがNSStringかどうかを確認してください。 – visakh7