App Store 链接未在 UIAlertView 中打开
此 App Store 链接无法正常工作的任何原因(按下它时没有任何反应)
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
rowsNumber = [NSNumber numberWithUnsignedInteger:sectionInfo.numberOfObjects];
if ([rowsNumber intValue] > 1) {
textField.hidden = YES;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"An Alert!"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Buy Full Version", nil];
[alert show];
[alert release];
}
NSLog(@"%d", [rowsNumber intValue]);
return [sectionInfo numberOfObjects];
}
- (void) alertView:(UIAlertView *) alertView buttonClickedAtIndex:(NSInteger) index {
if(index == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://phobos.apple.com/gb/app/stalk-it/id405797470?mt=8"]];
}
}
Any reason this App Store link isnt working properly (nothing happens when you press it)
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
rowsNumber = [NSNumber numberWithUnsignedInteger:sectionInfo.numberOfObjects];
if ([rowsNumber intValue] > 1) {
textField.hidden = YES;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"An Alert!"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Buy Full Version", nil];
[alert show];
[alert release];
}
NSLog(@"%d", [rowsNumber intValue]);
return [sectionInfo numberOfObjects];
}
- (void) alertView:(UIAlertView *) alertView buttonClickedAtIndex:(NSInteger) index {
if(index == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://phobos.apple.com/gb/app/stalk-it/id405797470?mt=8"]];
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试改变...
以...
Try changing...
to...