通过APPID从appStore获取应用最新信息
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
int appid = 414478124;
NSURLRequest *request = [NSURLRequest requestWithURL:URL(@"http://itunes.apple.com/lookup?id=%d",appid)];
NSURLConnection *Connection = [[NSURLConnection alloc]initWithRequest:request delegate:self];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{
self.receiveData = [NSMutableData data];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
[self.receiveData appendData:data];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection{
NSString *receiveStr = [[NSString alloc]initWithData:self.receiveData encoding:NSUTF8StringEncoding];
NSLog(@"%@",receiveStr);
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{
}
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。