I'm french, so sorry for my bad English...
I want to pass data NSString *cellSelected
.
Here is my code, thanks to say what is wrong :)
#import "PhotoViewController.h"
@interface PhotoCategoryViewController : UITableViewController
@property (nonatomic, strong) NSArray *categoryName;
@property (nonatomic,strong) NSString *cellSelected;
@end
@implementation PhotoCategoryViewController
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
self.cellSelected = cell.textLabel.text;
NSLog(@"selected cell textLabel = %@",self.cellSelected);
PhotoViewController *viewcontroller = [[PhotoViewController alloc] init];
viewcontroller.cellSelected = self.cellSelected;
}
and the second class :
#import "PhotoCategoryViewController.h"
@interface PhotoViewController : UICollectionViewController <UICollectionViewDataSource>
@property (nonatomic, strong) NSString *cellSelected;
- (void)viewWillAppear:(BOOL)animated
{
NSLog(@"%@", self.cellSelected);
}
It's right for the first NSLog, but for the second (the passed data), that returns : "nil" ... :(