i have 2 views i m sending text in a button on 1st view to label on second view....
//////textfieldtolabelViewController.h
#import <UIKit/UIKit.h>
#import "seconview.h"
@interface textfieldtolabelViewController : UIViewController {
IBOutlet seconview *sec;
//IBOutlet UITextField *t1;
}
//@property(nonatomic, retain)IBOutlet UITextField *t1;
-(void)buttonclick:(id)sender;
@end
and its .m file is this
#import "textfieldtolabelViewController.h"
@implementation textfieldtolabelViewController
-(void)buttonclick:(id)sender
{
NSString *s = [sender titleForState:UIControlStateNormal];
//sec.ss = s;
[sec settext:s];
[self presentModalViewController:sec animated:YES];
}
- (void)dealloc {
[super dealloc];
}
@end
now there is second view naming seconview .h file
#import <UIKit/UIKit.h>
@interface seconview : UIViewController {
IBOutlet UILabel *l1;
}
@property(nonatomic, retain)IBOutlet UILabel *l1;
-(void)settext:(NSString *)ss;
@end
and its .m file is ....
#import "seconview.h"
@implementation seconview
@synthesize l1;
//@synthesize ss;
-(void)settext:(NSString *)ss
{
l1.text=ss;
}
- (void)dealloc {
[super dealloc];
}
@end
this program did not show any error and runs fine but problem is that the text of button in 1st view does not appear in label on second view but i made all connection perfectly.......