I’m doing some very simple Core Data stuff with a storyboard, I am able to pass vars with segue but for some reason this one won’t let me.
I am trying to segue form this class to BlogDetailsViewcontroller with this call
-(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";
}
}
This is BlogDetailsViewController class
@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 !!
}
It worked fine for the other class, I did nothing different.
Any suggestions?
Using
==means you are doing a pointer comparison on the segue identifier, what you need is