【问题标题】:*.storyboard and standard *.xib*.storyboard 和标准 *.xib
【发布时间】:2012-01-02 07:49:34
【问题描述】:

我想在我的应用程序中进行水平分页,我发现我可以使用UIPageViewController,但这仅适用于情节提要。

我可以使用我的旧 *.xibs,但是在转换故事板(如果设备有 ios5)或 xib(如果设备有旧固件)之后编写命令使用?如果是,如何? 我想在这里做:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        [tableView deselectRowAtIndexPath:indexPath animated:YES];
        if (purchased == 1 && [indexPath row] == 1) {

        } else if (iOSversion > 5) {
//Use storyboard
} else{
            DetailsViewController *detailViewController = [[DetailsViewController alloc] initWithNibName:@"DetailsViewController" bundle:nil];
            detailViewController.item = [rssItems objectAtIndex:floor(indexPath.row)];
            [self.navigationController pushViewController:detailViewController animated:YES];
            [detailViewController release];
        }
    }

【问题讨论】:

    标签: iphone ios xcode ios5 uistoryboard


    【解决方案1】:

    这里有一个简单的方法来检查iOS版本是否为5:

    #define IOS_5 [[[UIDevice currentDevice] systemVersion] hasPrefix:@"5"]
    

    然后只需使用:

    if (IOS_5)
    

    (当然,当 iOS 6 出来时,你必须做更多的解析。)

    【讨论】:

    • 我知道,但我不知道,如何使用故事板。
    • -1 这绝不是检查设备和框架功能的推荐方法。
    猜你喜欢
    • 2013-03-12
    • 2013-08-26
    • 2014-08-24
    • 1970-01-01
    • 2016-12-10
    • 1970-01-01
    • 2012-02-09
    • 2012-01-16
    • 1970-01-01
    相关资源
    最近更新 更多