-1
我已经在ViewController和DetailViewController上设置了一个字段和一个按钮,如果数字小于10,我有一个标签设置为接收字符串“A”,如果数字小于10,则设置为“B”。但是,im我不确定如何访问它以显示结果。我至今:如何使用方法作为视图的标签返回?
#import "ViewController.h"
#import "ResultViewController.h"
@interface ViewController()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
ResultViewController *resultController = (ResultViewController *)segue.destinationViewController;
resultController.segueLabel = self.fieldLabel.text;
}
- (NSString *)number:(int)value {
int intVal = [[self.fieldLabel text] intValue];
if (intVal < 10) {
return @"a";
}
else {
return @"b";
}
}
- (IBAction)showResultView:(id)sender {
}
@end
不能告诉你在问什么,因为我没有看到你_doing_你'号什么:'方法。你想把这些信息发给谁? – matt
@matt我想用这种方法在下一个视图中显示@“a”或@“b”作为标签。目前该标签正在接收插入在self.fieldLabel.text字段中的文字,但我不希望来自该字段的信息,我需要将接收的方法编号的结果 – user1370624