iOS 中常用的幾個關鍵字的用法

2021-07-10 10:20:53 字數 992 閱讀 2399

const

nsstring *hscoder = @"feepees";

nsstring

const *hscoder = @"feepees";

*hscoder是不可修改的。
nsstring * const hscoder = @"feepees";
hscoder 是不可修改的。

#import "secondviewcontroller.h"

static int count;

@implementation secondviewcontroller;

.......

每當你進入該類count的值都會加一。

#import "splashviewcontroller.h"

nsstring* mestring=@"123";

@implementation splashviewcontroller

// nsstring* mestring=@"123";

.................

這兩 個地方都行

你可以在另外乙個類裡用到它:

#import "itennisviewcontroller.h"

extern nsstring* mestring;

@implementation itennisviewcontroller,這樣即可。

#define fp @「feepees」#import "itennisviewcontroller.h"

extern nsstring* mestring;

@implementation itennisviewcontroller

可以列印出「feepees」。

幾個關鍵字的用法

1.用register修飾變數時,盡可能會將這個變數儲存在cpu中的暫存器中,而不是通過記憶體定址的方式來訪問,是為了提高他的執行速率 2.register只能修飾整形和字元型,不能用來修飾浮點形。3.區域性靜態變數不能用register來修飾。用register修飾的變數只能是區域性變數,不能是全...

selenium中常用的關鍵字總結

關於警告框 alert prompt confirm switch to alert d webdriver.firefox alert d.switch to alert 獲取警告框資訊 alert.accept 確認操作 alert.dismiss 取消操作 alert.text 返回警告提示內...

關於時區的幾個常用關鍵字

1.cst central standard time 中部標準時間 2.est eastern standard time 東部標準時間 3.suse linux中的時區問題 http blog.chinaunix.net u1 45510 showart 357761.html suse lin...