It is very practical. Jump to fill in, return value assignment., very practical value assignment

Source: Internet
Author: User

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];}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.