In fact, I'm testing an example application on the iPhone ... where in the user interface, if I press the hello button, the message should be displayed in the text box ... so that when the button is pressed it should call a method present in another class , that is, from class 2 and displaying the message in the user interface so help me .... the following code is below I have two classes: class1 and class2 ... in class1 I'm calling
Class1.h
@interface class1 : UIViewController {
IBOutlet UILabel *statusText;
}
@property (nonatomic,retain)UILabel *statusText;
- (void)buttonpressed:(id)sender;
@end
class1.m
@implemenation class1
-(IBAction)sayhello:(id)sender
{
class1ViewController *class = [[class1ViewController alloc]init];
[class hello];
}
class2.h
@interface class2 : UIViewController {
UILabel *statusText;
}
@property(nonatomic,retain)UILabel *statusText;
-(void)sayhello:(id)sender;
@end
class2.m
@implementation class2
-(void)sayhello:(id)sender;
{
NSString *newtext = [[NSString alloc] initWithFormat:@"hello"];
statusText.text = newtext;
[newtext release];
}
, , , "HELLO", .... . IBAction ...
, .
...