I'm new to iOS and Its developing.i have read Xcode old style passing data between view controllers.there i have seen lot of things going with xib files.please find below the code i have used to pass data in-between ViewControllers.but there in customelink(please find DetailViewController.m)there I'm getting Null value.please help me to get String value there.and kind enough to explain what are the mistakes I've done here.
EssentialInfoController.h
#import <UIKit/UIKit.h>
#import "DetailViewController.h"
@interface Essentialinfocontroller : UIViewController
@end
EssentialInfoController.m
#import "Essentialinfocontroller.h"
@interface Essentialinfocontroller ()
@end
@implementation Essentialinfocontroller
- (void)viewDidLoad
{
[super viewDidLoad];
DetailViewController * customelink= [DetailViewController alloc ];
customelink.link=@"https://www.facebook.com";
}
@end
DetailViewController.h
#import <UIKit/UIKit.h>
@interface DetailViewController : UIViewController
@property(weak,nonatomic)NSString * link;
@end
DetailViewController.m
#import "DetailViewController.h"
@interface DetailViewController ()
@property(nonatomic,weak)NSString *customelink;
@end
@implementation DetailViewController
@synthesize link;
@synthesize customelink;
- (void)viewDidLoad
{
[super viewDidLoad];
self.customelink=self.link;
NSLog(@"link--> %@",customelink);// here 2014-07-06 21:21:51.469 WADTourisum[880:60b] link--> (null)
}
@end