故事板到笔尖

时间:2012-03-12 17:39:30

标签: objective-c ios xcode storyboard nib

我在RSS中有一个UITableView解析器,当选择其中一行时,它会推送到详细视图。我使用Nib文件的旧UI格式工作正常,但我想将所有内容转移到UIStoryboard。我了解到UIStoryboardsnibs是兼容的,所以我决定保留相同的代码,但将UITableView放在UIStoryboard中,并将详细视图设为自己的笔尖。我将所有内容联系起来并且它应该正常工作,它不会给我任何错误,但事实并非如此。有没有我错过的,或者说故事板和笔尖都不兼容。

修改

- (id)initWithItem:(NSDictionary *)theItem {
    if (self == [super initWithNibName:@"RssDetailController" bundle:nil]) {
        self.item = theItem;
        self.title = [item objectForKey:@"title"];
    }

    return self;
}

1 个答案:

答案 0 :(得分:1)

您是否正在从UIViewController UIStoryboard推送到NIB个文件?

如果有,请查看从故事板推送到NIB的{​​{3}}:

// in a navigation controller

// to load/push to new controller use this code

// this will be next screen
DetailsViewController *detailsViewController = [[DetailsViewController alloc ]init];
[self.navigationController pushViewController:detailsViewController animated:YES];


// to go back or pop controller use this
// now it will send back to parent screen
[self.navigationController popViewControllerAnimated:YES];