I have a problem with my iOS App Project. I want to transfer a value of my SearchViewController to my ResultGeneralInfoViewController. There are no bugs or issues but it doesn't work.
Here my Code in my SearchViewController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSDictionary *item = [searchResults objectAtIndex:[indexPath row]];
ResultGeneralInfosViewController *detailViewController = [ResultGeneralInfosViewController alloc];
detailViewController.companyName = [item objectForKey:@"companyName"];
NSLog([item objectForKey:@"companyName"]);
}
ResultGeneralInfoViewController.h
@interface ResultGeneralInfosViewController : UIViewController {
NSString *companyName;
}
@property NSString *companyName;
@property (weak, nonatomic) IBOutlet UILabel *companyNameLabel;
and ResultGeneralInfoViewController.m
@implementation ResultGeneralInfosViewController
@synthesize companyName;
//Outlets
@synthesize companyNameLabel;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
companyNameLabel.text = self.companyName;
}
Any ideas?