我正在用故事板做一些非常简单的核心数据的东西,我可以通过 segue 传递变量,但由于某种原因,这个不允许我。
我正在尝试BlogDetailsViewcontroller
通过这个电话将这个班级与这个班级联系起来
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if (segue.identifier == @"User'sBlogList2BlogDetails")
{
NSLog(@"this is self.users.sorted %@", self.user.sortedBlogs);
BlogDetailsViewController *bdvc = segue.destinationViewController;
bdvc.blog = [self.user.sortedBlogs objectAtIndex:self.tableView.indexPathForSelectedRow.row];
bdvc.temp = @" this is temp pass";
}
}
这是BlogDetailsViewController
课
@class Blog;
@interface BlogDetailsViewController : UITableViewController
{
NSString *temp;
}
@property(nonatomic, strong) Blog *blog;
@property(nonatomic, strong) NSString *temp;
@end
@implementation
@synthesize blog, temp;
-(void)viewDidLoad
{
NSLog(@"%@,%@", blog, temp); //comes back as null for both !!
}
对其他班级来说效果很好,我没有做任何不同的事情。有什么建议么?