macOS學習記錄 3

2021-08-30 02:16:38 字數 1492 閱讀 7058

xcode3.2環境下

1:字串連線

@inte***ce converter : nsobject 

@end

@end

a controller class:

@inte***ce controller : nsobject 

-(ibaction)converter:(id)sender;

@end

#import "controller.h"

#import "converter.h"

@implementation controller

//goal: show ipaddress+newmsg

//input: ipaddressfield and newmsgfield

//output: chatmsgfield

-(ibaction)converter:(id)sender

@end

類命名時大小寫很關鍵,區分identity。下乙個練習中,筆者全部用小寫,結果類方法和類名重複,報錯。

2.貨幣轉換器

//宣告模型類converter,類中有乙個計算匯率的例項方法convertamount

@inte***ce converter : nsobject

-(float)convertamount:(float)amt atrate:(float)rate;

@end///

#import "converter.h"

//實現類中的方法

@implementation converter

-(float)convertamount:(float)amt atrate:(float)rate

@end

/////宣告控制器類controller,四個插座變數用於獲取三個文字框,乙個模型類的資訊

//動作,當按下按鈕時向controller類傳送converter:訊息

@inte***ce controller : nsobject

-(ibaction)converter:(id)sender;

@end

///#import "controller.h"

#import "converter.h"

//實現動作,當按下按鈕時,獲取兩個文字框當內容作為引數,呼叫模型中當方法計算金額,再呼叫另乙個文字框當方法顯示金額

@implementation controller

-(ibaction)converter:(id)sender

@end

字串與float轉換-參考網友部落格

MacOS安裝記錄

注意 我使用32g的u盤在格式化時沒有guid選項會導致後續無法正常安裝,換16g則正常 安裝clover 其實只起到掛載作用clover檔案我們使用現成的 我使用的是clover是這個 e5 2680v2 華南x79v2 bios 安裝教程 1.重新整理主機板bios,把壓縮包裡面的bios資料夾...

Linux學習記錄(3)

ifconfig eth0 位址 ifconfig 檢視當前的位址ip vim文字編輯器 vim 開啟的該檔名 命令列模式 按i進入插入模式 底行模式 wq為儲存 wq 為強制儲存 在底行 set number可以顯示序號 sudo apt get install vim gtk set numbe...

Java學習記錄3

封裝就是把物件的資訊和內部邏輯結構隱藏起來 private default 如果類中成員不使用任何訪問控制符修飾,就稱它是包訪問許可權。使用包訪問許可權修飾的成員可以被相同包下的其他類訪問。protected 如果類成員中使用protected修飾,則這個成員既可以被同乙個包下的其他類訪問,也可以被...