做了一个简单的iphone应用,用于从其他位置复制文本。text1的值到text2。但是运行报出一些警报:
"Attributes on method implementation and its declaration must match"
"Incompatible pointer types sending 'UITextField *' to parameter of type 'NSString *"
两个文本都声明为UITextField。警报出现在setText那行。
#import "APPViewController.h"
@interface APPViewController ()
@end
@implementation APPViewController
-(IBAction)copy:(id)sender
{
[text2 setText:text1];
}
@end