It is very practical. Jump to fill in, return value assignment., very practical value assignment
//// IntextViewController. h // resume /// Created by on 16/7/1. // Copyright©2016 All rights reserved. // # import "BaseViewController. h "@ interface IntextViewController: BaseViewController @ property (nonatomic, strong) NSString * editStr; @ property (nonatomic, assign) id delegate; @ property (weak, nonatomic) IBOutlet UITextView * editTextView; @ property (nonatomic, assign) NSInteger count; @ end
/// IntextViewController. m // resume /// Created by on 16/7/1. // Copyright©2016. all rights reserved. // # import "IntextViewController. h "# import" InvitationViewController. h "@ interface IntextViewController () @ property (strong, nonatomic) UIButton * rightBarBtn; @ end @ implementation IntextViewController-(void) viewDidLoad {[super viewDidLoad]; [self addTopBackView]; [self addtitleWithName: @ "Enter company information"]; [self addRightBarButtomWithButton: self. rightBarBtn]; UIButton * button = [UIButton buttonWithType: Custom]; [button setBackgroundImage: [UIImage imageNamed: @ "back"] forState: UIControlStateNormal]; [button addTarget: self action: @ selector (leftButtonClicked) forControlEvents: UIControlEventTouchUpInside]; button. frame = CGRectMake (10, 20 + 7, 30, 30); [self. view addSubview: button]; // [self addLeftBarButtonItem]; _ editTextView. text = [NSString stringWithFormat: @ "% @", _ editStr]; [_ editTextView becomeFirstResponder];}-(UIButton *) rightBarBtn {if (_ rightBarBtn = nil) {_ rightBarBtn = [UIButton buttonWithType: Encrypted]; [_ rightBarBtn setTitle: @ "modify" forState: Encrypted]; [_ rightBarBtn setTitleColor: [UIColor whiteColor] forState: Encrypted]; [_ rightBarBtn addTarget: self action: @ selector (leftButtonClicked) forControlEvents: UIControlEventTouchUpInside]; _ rightBarBtn. frame = CGRectMake (0, 0, 60, 40);} return _ rightBarBtn;}-(void) leftButtonClicked {if (self. delegate & [self. delegate respondsToSelector: @ selector (getTextView: with :)]) {[self. delegate getTextView: _ editTextView. text with: _ count];} [self. navigationController popViewControllerAnimated: YES];}-(void) didReceiveMemoryWarning {[super didreceivemorywarning]; // Dispose of any resources that can be recreated .} # pragma mark -- determine whether the string is a pure number-(BOOL) isPureInt :( NSString *) string {ns1_* scan = [ns1_scannerwithstring: string]; int val; return [scan scanInt: & val] & [scan isAtEnd] ;}@ end
Write this method on your homepage.
// Obtain the entered text-(void) getTextView :( NSString *) text with :( NSInteger) index {[_ contentAry replaceObjectAtIndex: index withObject: text]; [_ infoTable reloadData]; // modify if (index = [_ contentAry count]-1) {[_ signTextView setText: text] ;}} for textview.
Finally, replace part of the cell with the obtained text.
-(IBAction) touchedTextView :( id) sender {EditInfoViewController * editView = [[EditInfoViewController alloc] initWithNibName: @ "EditInfoViewController" bundle: nil]; editView. hidesBottomBarWhenPushed = YES; editView. count = [_ contentAry count]-1; editView. delegate = self; editView. editStr = [_ contentAry objectAtIndex: [_ contentAry count]-1]; editView. textLength = 140; editView. titleName = @ "job description"; [self. navigationController pushViewController: editView animated: YES];}