ios學習筆記

2021-06-13 09:43:46 字數 948 閱讀 5080

actionsheet:

標頭檔案裡加協議。

- (ibaction)buttonpressed:(id)sender 

- (void)actionsheet:(uiactionsheet *)actionsheet

diddismisswithbuttonindex:(nsinteger)buttonindex

}

從plist裡讀資料【08 - sections】:

@property (strong, nonatomic) nsdictionary *names;

@property (strong, nonatomic) nsarray *keys;

nsstring *path = [[nsbundle mainbundle] pathforresource:@"sortednames"

oftype:@"plist"];

nsdictionary *dict = [[nsdictionary alloc]

initwithcontentsoffile:path];

self.names = dict;

nsarray *array = [[names allkeys] sortedarrayusingselector:

@selector(compare:)];

self.keys = array;

是否iphone5

#define iphone5 ([uiscreen instancesrespondtoselector:@selector(currentmode)] ? cgsizeequaltosize(cgsizemake(640, 1136), [[uiscreen mainscreen] currentmode].size) : no)

IOS學習筆記

uiview beginanimations view flip context nil 設定動畫塊 uiview setanimationduration 1.25 動畫時間 uiview setanimationcurve uiviewanimationcurveeaseinout 動畫曲線 u...

ios學習筆記

1.nsselectorfromstring nsstring string 從乙個字串構建乙個selector.2.字串 cocoa處理字串的類nsstring和它的子類nsmutablestring。id stringwithformat nsstring format,指可以接受以逗號分開的多...

IOS 學習筆記

uiviewkayframeanimationoptions cadisplaylink draw 當建立乙個新的view時,其自動生成乙個draw方法,且此方法可以被重寫,一旦draw 方法m,被呼叫,cocoa就會為我們建立乙個圖形上下文,在圖形上下文中所有操作最終都會反映在當前的uiview介...