你好,歡迎來到IOS教程網

 Ios教程網 >> IOS使用技巧 >> IOS技巧綜合 >> IOS之表視圖單元格刪除、移動及插入

IOS之表視圖單元格刪除、移動及插入

編輯:IOS技巧綜合
[摘要]本文是對IOS之表視圖單元格刪除、移動及插入的講解,對學習IOS蘋果軟件開發有所幫助,與大家分享。

#import"AppUtils.h"
#include"RIButtonItem.h"
#include"UIAlertView+Blocks.h"

@implementationAppUtils

//彈出警告框,並實現警告框按鈕的觸發事件
-(void)showInputDialogWithTitle:(NSString*)titlemessage:(NSString*)messagetoAlertView:(UIAlertView*)alertconfirmAction:(void(^)(void))action{
RIButtonItem*cancelItem=[RIButtonItemitem];
cancelItem.label=@"No";
cancelItem.action=^
{
//為NO時的處理
UITextField*tf=[alerttextFieldAtIndex:0];
NSLog(@"UITextField=%@",tf.text);
};

RIButtonItem*confirmItem=[RIButtonItemitem];
confirmItem.label=@"Yes";
//confirmItem.action=action;
alert=[alertinitWithTitle:title
message:message
cancelButtonItem:cancelItem
otherButtonItems:confirmItem,nil];

alert.alertViewStyle=UIAlertViewStylePlainTextInput;

confirmItem.action=action;
[alertshow];
}
@end

#import "AppUtils.h"
#include "RIButtonItem.h"
#include "UIAlertView+Blocks.h"

@implementation AppUtils

//彈出警告框,並實現警告框按鈕的觸發事件
- (void)showInputDialogWithTitle:(NSString *)title message:(NSString *)message toAlertView:(UIAlertView*) alert confirmAction:(void(^)(void))action{
    RIButtonItem* cancelItem = [RIButtonItem item];
    cancelItem.label = @"No";
    cancelItem.action = ^
    {
        //為NO時的處理
        UITextField *tf=[alert textFieldAtIndex:0];
        NSLog(@"UITextField=%@",tf.text);
    };
    
    RIButtonItem* confirmItem = [RIButtonItem item];
    confirmItem.label = @"Yes";
//    confirmItem.action = action;
    alert = [alert initWithTitle:title
                                                    message:message
                                           cancelButtonItem:cancelItem
                                           otherButtonItems:confirmItem, nil];
    
    alert.alertViewStyle = UIAlertViewStylePlainTextInput;
    
    confirmItem.action = action;
    [alert show];
}
@end

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved