我必须集成雅虎api在我的应用程序。有没有人能给我提供一些步骤呢?
由于我们整合了雅虎,我们从雅虎得到了一个令牌,在输入密钥后,我们进入了application.Does,任何人都可以在雅虎登录后直接进入应用程序。
发布于 2011-09-09 20:23:08
试试这个初学者链接:
http://developer.yahoo.com/social/sdk/objectivec/
发布于 2011-09-10 02:59:29
下面是使用Yahoo!的XML部分的代码子集答案。我写这篇文章是为了写我自己的答案应用。
NSString *question = @"Who won the 1975 World Series?";
NSString *address = @"http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=iQuestion&query=";
NSString *request = [NSString stringWithFormat:@"%@%@",address,question];
NSURL *URL = [NSURL URLWithString:request];
NSError *error;
NSString *XML = [NSString stringWithContentsOfURL:URL encoding:NSASCIIStringEncoding error:&error];
// Extract current answer the 'dirty' way
NSString *answer = [[[[XML componentsSeparatedByString:@"<ChosenAnswer>"]
objectAtIndex:1] componentsSeparatedByString:@"</ChosenAnswer>"] objectAtIndex:0];
NSLog(@"%@", answer);XML提取非常粗糙,如果您愿意的话,最好的替代方法是使用XMLParser或XMLDocument,而不是进行字符串推断。它有点像是个黑人聚居区
https://stackoverflow.com/questions/7361290
复制相似问题