Time of Update: 2013-12-10
方式一:self.title=@"標題文字";或self.title=[[[NSBundle mainBundle] infoDictionary]
Time of Update: 2013-12-10
(註:環境Mac OS X Lion 10.7.3 + Xcode 4.2.1 + iOS SDK 5.0.)比如工程中添加了一個UIViewController的sub class,建立的時候選中“With XIB for user interface”,則建立完成會同時產生三個檔案:xxx.h, xxx.m, xxx.xib(前期也可是*.nib,xib和nib都指UI源檔案,後來蘋果統一用xib尾碼名了)。xxx.h預設內容:#import
Time of Update: 2013-12-10
//添加鍵盤的監聽事件[[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotificationobject:nil]; #pragma mark 滾動scrollview 使被隱藏的textfield顯示在螢幕正確的位置(軟鍵盤的上方)-
Time of Update: 2013-12-10
用過ImagePickerController,應該比較熟悉這段代碼:UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];imagePicker.delegate = self; imagePicker.sourceType = sourceType; if (popover) { [popover
Time of Update: 2013-12-10
擋住的處理事件位址在:http://www.bkjia.com/kf/201203/121641.html以下是還原的處理事件:註冊監聽事件:[[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(keyboardWillBeHidden:) name:UIKeyboardWillHideNotificationobject:nil];事件代碼:-
Time of Update: 2013-12-10
//asp.net中的web.config中,需要開啟get方式或者post方式<system.web> <webServices> <protocols> <add name="HttpSoap"> <add name="HttpPost"> <add name="HttpGet"> <add name=&
Time of Update: 2013-12-10
指標是一個特殊的變數,它裡面儲存的數值被解釋成為記憶體裡的一個地址。要搞清一個指標需要搞清指標的四方面的內容:指標的類型,指標所指向的 類型,指標的值或者叫指標所指向的記憶體區,還有指標本身所佔據的記憶體區。指標的類型 從文法的角度看,你只要把指標聲明語句裡的指標名字去掉,剩下的部分就是這個指標的類型。這是指標本身所具有的類型。讓我們看看例一中各個指標的類型: (1)int*ptr;//指標的類型是int* (2)char*ptr;//指標的類型是char* (3)int**ptr;//
Time of Update: 2013-12-10
在程式中調用系統內建的應用,比如我進入程式的時候,希望直接調用safar來開啟一個網頁,下面是一個簡單的使用:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen
Time of Update: 2013-12-10
- (void) hideTabBar:(BOOL) hidden{ [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0]; for(UIView *view in
Time of Update: 2013-12-10
NSString *dateStr=[dic objectForKey:@"date"];// 2012-05-17 11:23:23 NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSUInteger unitFlags =
Time of Update: 2013-12-02
簡述 在應用的一些設定中經常要用到一些Picker來快速協助使用者選定取值,一般會用到的有UIDatePicker,UIPickerView以及UIImagePickerController。 初始介面 ,在搭建好的介面,實現方法來完成各個選擇。首先是日期選擇 UIDatePicker 主要需要設定的屬性有localedatePickerMode [cpp] UIDatePicker *datePicker = [
Time of Update: 2013-11-16
配置推播通知比較麻煩,需要iOS開發人員帳號,然後配置一個Apple ID、配置概要檔案和SSL認證。 1 認證簽章要求首先需要認證簽章要求,這需要在Mac OS X系統中完成,通過在系統中選擇“工具 +
Time of Update: 2013-11-16
首先看TableView擷取cell執行個體的方法- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath涉及Cell執行個體化的代碼:PostCell *cell = (PostCell * (! NSArray *objects = [[NSBundle mainBundle] loadNibNamed:
Time of Update: 2013-11-16
最近在QQ群裡好多人問一些比較基礎的問題,在這羅列一下:1、鍵盤上的斜杠鍵壞掉了,怎麼樣用快速鍵進行注釋呢?首先在Xcode中注釋的預設快速鍵為:command+/;其次可以自行修改快速鍵:Xcode>Preferences...>Key
Time of Update: 2013-11-16
iOS 是目前最為安全可靠的移動平台,但既然是軟體就不會是無堅不摧的。喬治亞技術資訊資訊安全中心 (Georgia Tech Information Security Center)的研究員不久前聲稱,他們最近新發現了 iOS 的重大漏洞。該機構在報告中稱,這個漏洞很有可能成為“現有 iOS 系統需要面對的首要威脅”,它能夠在使用者難以察覺有異樣的情況下,通過一些看起來無害的應
Time of Update: 2013-11-16
在c++中聲明函數,名為functionCpp,通過spidermonkey中jsapi的JS_DefineFunction綁定一個js函數,名為functionJS,此函數名2.c++調用js函數在js中聲明函數,名為functionJS,通過spidermonkey中jsapi的JS_CallFunctoionName(也可用JS_CallFunction,但參數不一樣), haha = testjs("js run hahhahaha""return from c++ :true"
Time of Update: 2013-11-16
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor];
Time of Update: 2013-11-16
UIButton *btn=[[UIButton alloc]initWithFrame:CGRectMake(60, 60, 200, 60)]; btn.backgroundColor=[UIColor greenColor]; [btn setTitle:@"btn1" forState:UIControlStateNormal]; [self.view addSubview:btn]; UIButton
Time of Update: 2013-11-16
"language" ="english";"language" ="中文"; NSLog(@"%@",NSLocalizedString(@"language",
Time of Update: 2013-11-16
以前在cocos2d-x項目中用到json解析,整合了libjson庫後發現網上提供的解析方法大多是在解析過程中取得值,並沒有將解析結果有效儲存起來,於是摸索一番,把解析結果根據資料格式存到數組或字典當中。 不敢獨享,代碼奉上: JsonUtil:: parseArrJSON(JSONNODE *n,CCObject ** (n == isAry= JSONNODE_ITERATOR it = *key=json_name(* (strcmp(key, )==