一個很實用的,跳轉填寫 , 回來賦值.

来源:http://www.cnblogs.com/fume/archive/2016/07/06/5647935.html
-Advertisement-
Play Games

在你的主頁面里寫上這個方法 最後用你獲取的text取代cell的一部分 ...


//
//  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:@"公司信息填寫"];
    [self addRightBarButtomWithButton:self.rightBarBtn];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [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:UIButtonTypeCustom];
        [_rightBarBtn setTitle:@"修改" forState:UIControlStateNormal];
        [_rightBarBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_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 didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma  mark -- 判斷字元串是否是純數字
-(BOOL)isPureInt:(NSString *)string{
    
    NSScanner* scan = [NSScanner scannerWithString:string];
    
    int val;
    
    return [scan scanInt:&val] && [scan isAtEnd];
    
}

@end

 

 

在你的主頁面里寫上這個方法

//獲取填寫的text
-(void)getTextView:(NSString *)text with:(NSInteger )index{
    [_contentAry replaceObjectAtIndex:index withObject:text];
    [_infoTable reloadData];
    
    //最後為textview的修改
    if (index == [_contentAry count]-1) {
      [_signTextView setText:text];
    }
}

 

最後用你獲取的text取代cell的一部分

 

- (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 = @"職位描述";
    [self.navigationController pushViewController:editView animated:YES];
}

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 對AFNetworking+MBProgressHUD的二次封裝,使用更方便,適用性非常強: 一句話搞定網路提示; 再也不用擔心網路庫更新後,工程要修改很多地方了!網路庫更新了只需要更新這個封裝好的庫。 不足之處歡迎指正 使用方法簡介: [MBProgressHUD showAutoMessage: ...
  • *res/raw和assets的相同點: 1.兩者目錄下的文件在打包後會原封不動的保存在apk包中,不會被編譯成二進位。 *res/raw和assets的不同點:1.res/raw中的文件會被映射到R.java文件中,訪問的時候直接使用資源ID即R.id.filename;assets文件夾下的文件 ...
  • 重寫onKeyDown事件即可 @Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { moveTaskToBack(false); return ...
  • 之前因為工作需要要實現一個類似的 懸浮+視差的headerView的效果, 研究了好久沒研究出來怎麼做,最後用UICollectionView + CSStickyHeaderFlowLayout的方法實現了(不得不說CSStickyHeaderFlowLayout真的是一個很強大的庫,作者對UIC ...
  • //顯示動畫 dialog = new Dialog(context, R.style.loading); dialog.setContentView(R.layout.loadinglayout);//此處佈局為一個progressbar dialog.setCancelable(true); / ...
  • 一,效果圖。 二,工程圖。 三,代碼。 AppDelegate.m #import "AppDelegate.h" //加入頭文件 #import "RoundDiskViewController.h" @implementation AppDelegate - (BOOL)application: ...
  • Android 5.0之後Android新增加的兩個UI控制項RecyclerView,CardView。 RecyclerView可以看出是ListView的加強版,能夠更加靈活的使用、支持動畫等 CardView則是Google提供的一個卡片式視圖組件,可以定義如邊角的弧度、陰影等屬性。從本質上看 ...
  • AsyncTask定義了三種泛型類型 Params,Progress和Result。 Params 啟動任務執行的輸入參數,比如HTTP請求的URL。 Progress 後臺任務執行的百分比。 Result 後臺執行任務最終返回的結果,比如String。 Params 啟動任務執行的輸入參數,比如H ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...