Time of Update: 2018-12-06
使用的是GameKit的架構遵循協議:<GKPeerPickerControllerDelegate,GKSessionDelegate>@property (strong, nonatomic) GKSession *currentSession;@property (strong, nonatomic) GKPeerPickerController *picker;串連時 picker =[[GKPeerPickerController alloc] init];
Time of Update: 2018-12-06
apple中文文檔 http://www.apple.com.cn/developer/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/GraphicsandDrawing/GraphicsandDrawing.html"避免在滾動過程中清除原先的內容預設情況下,在調用drawRect:方法對視圖的某個地區進行更新之前,UIKit會清除該地區對應的上下文緩衝區。如果您對視圖的滾動事件進行響應,則在滾動
Time of Update: 2018-12-06
由於項目中有這樣一個需求:需要在儲存是彈出框選擇儲存的地點。選擇UIAlertView來實現,但是要在UIAlertView中增加UISwitch的控制項,這就需要自訂一個繼承UIAlertView的類來自訂UIAlertView了。實現效果如下:(還沒加圖的)我需要在點擊確定的時候,知道兩個Switch的狀態,才能進一步做相應的功能。自訂了SaveAlertView類。在.h中,需要自訂一個@protocol,作為把switch狀態傳出去的出口。聲明相應的委託。看源碼#import
Time of Update: 2018-12-06
Parameters URLStringThe string with which to initialize the NSURL object. This string must conform to URL format as described in RFC 2396. This method parses URLString according to RFCs 1738 and 1808. DiscussionThis method expects URLString to
Time of Update: 2018-12-06
定義兩個方法:- (NSString *)dataFilePath;擷取返回資料檔案的完整路徑名- (void)applicationWillResignActive:(NSNotification *)notification;儲存資料,參數notification的作用是在對象之間傳遞通知,保持通訊。#define kFilename @"data.plist"- (NSString *)dataFilePath { NSArray *paths =
Time of Update: 2018-12-06
queue有三種 Main: tasks execute serially on your application’s main threadConcurrent: tasks start executing in FIFO order, but can run concurrently.Serial: tasks execute one at a time in FIFO order(1)serial queues(串列隊列)又稱私人調度隊列(private),一般用再對特定資源的同步訪問上。
Time of Update: 2018-12-06
設定layer的path為NSBezierPath對象,再對layer添加animation,注意[CABasicAnimation animationWithKeyPath:@"strokeEnd"] 中的keyPath不能隨意更改。CAShapeLayer *l = [CAShapeLayer layer];l.frame = self.view.bounds;l.strokeColor = [UIColor redColor].CGColor;CGPoint start =
Time of Update: 2018-12-06
設定一個Button,點擊可以刪除,移動排序tableView,如下:左邊為移動,右邊為刪除 先說移動:button要設定IBAction- (IBAction)toggleMove { [self.tableView setEditing:!self.tableView.editing animated:YES]; if (self.tableView.editing)
Time of Update: 2018-12-06
• Classes -> 來源程式檔案(.h、.m)• Other Sources-> main.m 等,不需要程式員修改 -Prefix.pch• Resources -> 介面檔案(.xib)、設定檔-info.plist• Frameworks -> 連結的庫• Targets -> 項目的不同Target(資源、編譯配置不同)• Executables ->
Time of Update: 2018-12-06
因為在看win8時看到Promises的非同步模式。kinfey讓我們去摸下WindJS(就是之前的Jscex),WindJS的具體操作會在之後總結,可先看看文檔http://windjs.org/cn/docs/。看WinJS時接觸到$await,從其作者--老趙的部落格中可找到其描述。Check:淺談Jscex的$await語義及非同步任務模型簡單小結:$await的語義:如果該任務沒有運行,則啟動該任務。如果該任務已經完成,則立即返回結果(或拋出異常)。例子:假如有三個任務:A和B可以並行
Time of Update: 2018-12-06
在做要用到Core Data 相關的項目,突然出現錯誤"NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save
Time of Update: 2018-12-06
有時要要使數組順序顛倒,如果只是輸出,則可以用 [array reverseObjectEnumerator]實現NSArray * array = [NSArray arrayWithObjects:@"wang", @"zhou", @"xiaozhou", nil]; //正序輸出 for (NSString * str in array) { NSLog(@"%@", str); } //反序輸出 for (NSString * str in [array
Time of Update: 2018-12-06
strong關鍵字與retain關似,用了它,引用計數自動+1,用執行個體更能說明一切 @property (nonatomic, strong) NSString *string1; @property (nonatomic, strong) NSString *string2; 有這樣兩個屬性, @synthesize string1; @synthesize string2; 猜一下下面代碼將輸出什麼結果? self.string1 = @"String 1";
Time of Update: 2018-12-06
建立工具列不是十分簡單,直接用winjs的控制項appbar就行。直接看官方代碼:在HTML中: <div id="createAppBar" data-win-control="WinJS.UI.AppBar" data-win-options=""> <button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdAdd',label:'Add',icon:'add'
Time of Update: 2018-12-06
建一個Single View Application的project。部分代碼:#import <UIKit/UIKit.h>@interface BIDViewController : UIViewController@property (strong, nonatomic) IBOutlet UITextField *nameField;@property (strong, nonatomic) IBOutlet UITextField *numberField;-
Time of Update: 2018-12-06
將要開始的學習是win8上的metro app 的開發。體驗win8過後可以感受到微軟的誠意,win8 is so cool ! 而Mertro app 個人覺得更是把win8 看出是與android iphone 類似的用戶端來開發。並且還有一點很重要的,metro app 允許用web的技術去開發,這幾天出的firefox os 也雷同,或許這會是下個大趨勢,呵呵,拭目以待咯!
Time of Update: 2018-12-06
官方文檔:http://msdn.microsoft.com/en-us/library/windows/apps/br229776.aspxWinJS.Class.define 類定義var object = WinJS.Class.define(constructor, instanceMembers, staticMembers);三個參數是:建構函式,執行個體成員集合,靜態成員集合。e.g.var Robot = WinJS.Class.define( function(name) {
Time of Update: 2018-12-06
My first metro app in win8:hello grilfrom 官方文檔:http://msdn.microsoft.com/en-us/library/windows/apps/hh986964.aspx看效果:建一個blank App;先看project 組成:References:庫的引用css:裡面一個default.css 放置樣式內容images:圖片檔案夾js:檔案夾,裡面一個default.js js檔案default.html Hello
Time of Update: 2018-12-06
無聊做了一個todoList的應用來練練手。先po張介面圖:從介面可以看到基本的控制項,主要是一個輸入框,一個添加按鈕,一個刪除按鈕,加一個listView。關於listview的添加可以參照我之前寫的win8: ListView 。Add:每次在輸入之後點擊Add button,會把輸入框內容push進一個dataArray中,再以此設為listview的資料來源, var dataList = new WinJS.Binding.List(dataArray);
Time of Update: 2018-12-06
核心:內容重於形式。1、解析度:最小1024*768 建議:1366*768。2、橫向流動,可縱向,但縱向不應超出橫向。3、建議大背景,注意留白。4、邊緣對齊(但避免居住對齊)。5、文字: tittle:42pt subtitles:20pt content:11pt 注釋:9pt6、硬規定:左上因留一個120*100的地區。即title 的基準距上邊框最小為100像素,內容距左邊最小為120像素。這樣的好處最大是為了不同螢幕的適配問題。