0

textView のテキストをラベルに渡そうとしてviewControllertextViewますlabel

初め

.m

textView= [[UITextView alloc] initwithFrame...

//ビューを変更し、テキストビューをラベルに送信

-(void) gotoSecond:(id) sender{
Second *sec = [[Second alloc]initWithNibName: @"Second" bundle:nil];
[sec.note setText:textView.text]
[self presentViewController:sec animated: YES completion:NULL]; 

}

Second .h

//ペン先に付いている

@propery (nonatomic, strong) IBOutlet UILabel *note; 
4

2 に答える 2

0

これを使って:

-(void) gotoSecond:(id) sender{
    Second *sec = [[Second alloc]initWithNibName: @"Second" bundle:nil];
    [self presentViewController:sec animated: YES completion:^(){
         [sec.note setText:textView.text];
    }]; 
}
于 2013-08-19T14:36:14.907 に答える
0

これを使って:

viewController.m 内

-(void) gotoSecond{
secondViewController *sec = [[secondViewController alloc]initWithNibName: @"Second" bundle:nil];
[sec.passedText setText:textView.text]
[self presentViewController:sec animated: YES completion:NULL]; 

}

secondViewController.h で

@property(nonatomic, strong)NSString *passedText;

secondViewController.m で

-(void)viewDidLoad
{
   self.note.text = passedText;
}
于 2013-08-19T13:02:33.600 に答える