Objective-C 入門指南 - EncryptController.h




EncryptController.h 的原始程式碼如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#import <Cocoa/Cocoa.h>
#import "Encrypt.h"
 
@interface EncryptController : NSObject {
    // 輸入欄
    IBOutlet NSTextField *inputField;
    // 輸出欄
    IBOutlet NSTextField *outputField;
    // 提示訊息欄
    IBOutlet NSTextField *displayField;
  
    // 編碼與解碼的 Encrypt 物件
    Encrypt *encrypt;
    // 暫存輸入欄的 NSString 字串
    NSString *inputText;
    // 暫存輸出欄的 NSSTring
    NSString *outputText;
    // 提示訊息欄的 NSSTring
    NSString *displayText;
}
 
@property (retain) Encrypt *encrypt;
@property (retain) NSString *inputText, *outputText, *displayText;
 
// 輸入完按 Enter 鍵的動作
- (IBAction) inputSomething: (id)sender;
// 建立新的 Encrypt 物件
- (IBAction) newEncrypt: (id)sender;
// 載入已儲存的 Encrypt 物件
- (IBAction) loadEncrypt: (id)sender;
// 儲存 Encrypt 物件
- (IBAction) saveEncrypt: (id)sender;
// 編碼並顯示結果
- (IBAction) encode: (id)sender;
// 解碼並顯示結果
- (IBAction) decode: (id)sender;
// 清除所有項目,所括輸入內容與顯示結果
- (IBAction) clear: (id)sender;
// 拷貝解碼後的 NSString 字串到系統剪貼簿
- (IBAction) copy: (id)sender;
 
@end


您可以繼續參考
範例程式碼


相關目錄
Objective-C 入門指南
Objective-C 教材
首頁



參考資料
Learning Objective-C: A Primer
The Objective-C Programming Language
Cocoa Fundamentals Guide
Coding Guidelines for Cocoa
Advanced Memory Management Programming Guide
Archives and Serializations Programming Guide

沒有留言: