I have a Detail View Controller which contains data passed from a Table View:
#import "BRProjectsDetailViewController.h"
@interface BRProjectsDetailViewController ()
@end
@implementation BRProjectsDetailViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (IBAction)unwindBackToProjectsDetailViewController:(UIStoryboardSegue *)seque;
{
NSLog(@"unwindBackToHomeViewController!");
}
///used to feed data from homeview into detail view
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSLog(@"viewWillAppear");
NSString *name = self.projects[@"name"];
self.title = name;
NSString *description = self.projects[@"description"];
self.descriptionView.text = description;
}
I want to take the variable string labelled 'name' above and pass the contents of this to a collection view controller, currently coded below. At the moment, before doing conditioning I'm just trying to get a response from my NSLog. Currently it just returns null: . This is just an excerpt from the code: Can anyone help please?
#import "BRCollectionViewController.h"
#import "BRCollectionViewCell.h"
#import "BRProjectsDetailViewController.h"
@interface BRCollectionViewController ()
{
///add arrays for photos - to update once photos known
NSArray *imagesOne;
NSArray *imagesTwo;
}
@end
@implementation BRCollectionViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad {
//added this
NSString *name;
NSLog(@"%@", name);
//
}
@end