App Store 链接未在 UIAlertView 中打开

发布于 2024-10-07 21:06:42 字数 1226 浏览 0 评论 0原文

此 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一身软味 2024-10-14 21:06:42

尝试改变...

- (void) alertView:(UIAlertView *) alertView buttonClickedAtIndex:(NSInteger) index

以...

- (void) alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger) index

Try changing...

- (void) alertView:(UIAlertView *) alertView buttonClickedAtIndex:(NSInteger) index

to...

- (void) alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger) index
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文