I am trying pushViewController in iOS.But the execution result is following


When i hit the button it will make a transition from view A to View B. Here is my code for view A
#import <UIKit/UIKit.h>
#import "ViewControllerB.h"
@interface ViewControllerA : UIViewController
-(IBAction)next:(id)sender;
@end
in .m file
#import "ViewControllerA.h"
@interface ViewControllerA ()
@end
@implementation ViewControllerA
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(IBAction)next:(id)sender
{
ViewControllerB *viewController=[[ViewControllerB alloc]init];
viewController.string=@"tunvir";
[self.navigationController pushViewController:viewController animated:YES];
}
@end
in viewController B
@interface ViewControllerB : UIViewController
@property (nonatomic,strong)NSString *string;
@end
In .m file
#import "ViewControllerB.h"
@interface ViewControllerB ()
@end
@implementation ViewControllerB
@synthesize string=_string;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
@end
In want to set the string in viewB to "tunvir" and load the object as viewB. but a lot of warning appears.Why this is happening and how to fix this?Thanks