Hi i have two view controller: FirstViewController and SecondViewController
FirstViewController.h
#import <UIKit/UIKit.h>
@interface FirstViewController: {
NSString *prStr;
}
-(IBAction)setString;
@property (nonatomic, retain) NSString *prStr;
@end
FirstViewController.m
#import"FirstViewController.h"
@implementation FirstViewController
@synthesize prStr;
-(IBAction)setString{
prStr = [[NSString alloc]initWithFormat:@"1"];
}
SecondViewController.h
#import <UIKit/UIKit.h>
@class FirstViewController;
@interface SecondViewController: {
FirstViewController *pr;
}
-(IBAction)example;
@property (nonatomic, retain) FirstViewController *pr;
@end
SecondViewController.m
#import"SecondViewController.h"
#import "FirstViewController.h"
@implementation SecondViewController
@synthesize pr;
-(IBAction)example{
NSLog(pr.prStr);
if([pr.prStr isEqualToString:@"1"]==YES){
//Do Something }
}
When i build and run app, at execution of IBAction example, on debugger console doesn't appear anything!! How can access to the string of FirstViewController from action of SecondViewController, in order to display it on the debugger console???