Time of Update: 2018-12-05
Coacoa Touch提供了兩種表格方法來防止儲存格被持久選中第一種方法:cell.selectionStyle = UITableViewCellSelectionStyleNone;這樣做可以禁用選定儲存格上顯示的藍色或灰色覆蓋圖。第二種方法:通知表格取消儲存格選中狀態(調用deselectRowAtIndexPath:animated:)-(void) deselect:(id) sender{ [self.tableView
Time of Update: 2018-12-05
文章目錄 真相One more stepFurthor more 在objc中的類實現中經常看到這兩個關鍵字”self”和”super”,以以前oop語言的經驗,拿c++為例,self相當於this,super相當於調用父類的方法,這麼看起來是很容易理解的。 以下面的代碼為例:?12345678910111213141516171819202122232425262728@interface Person:NSObject
Time of Update: 2018-12-05
核心應用程式架構應用程式的生命週期 主函數main常式只做三件事:建立一個自動釋放池,調用UIApplicationMain函數,以及使用自動釋放池。應用程式的委託監控應用程式的進階行為是應用程式委託對象的責任,而應用程式委派物件是您提供的定製類執行個體。應用程式的委派物件負責處理幾個關鍵的系統訊息。每個iPhone應用程式都必須有應用程式委派物件,它可以是您希望的任何類的執行個體,但需要遵循UIApplicationDelegate協議,該協議的方法定義了應用程式生命週期中的某些掛鈎,您可
Time of Update: 2018-12-05
在ios5之前的系統中,可以通過定義導航條類別的方式自訂導航條:@implementation UINavigationBar (CustomImage)- (void)drawRect:(CGRect)rect {// Drawing code UIImage *image = [[UIImage imageNamed:@"header.png"] retain]; [image drawInRect:CGRectMake(0, 0,self.frame.size.width ,
Time of Update: 2018-12-05
編碼:stringByAddingPercentEscapesUsingEncoding:Returns a representation of the receiver using a given encoding to determine the percent escapes necessary to convert the receiver into a legal URL string.- (NSString
Time of Update: 2018-12-05
//無色cell.selectionStyle = UITableViewCellSelectionStyleNone;//藍色cell.selectionStyle = UITableViewCellSelectionStyleBlue;//灰色cell.selectionStyle = UITableViewCellSelectionStyleGray;Cell Selection StyleThe style of selected cells.typedef enum {
Time of Update: 2018-12-05
今天程式在啟動並執行時候收到了以下的資訊:2011-10-27 14:04:42.119 JingDuTianXia[6465:707] Received memory warning. Level=22011-10-27 14:04:42.122 JingDuTianXia[6465:707] applicationDidReceiveMemoryWarning(gdb) continueProgram received signal:
Time of Update: 2018-12-05
取消非同步請求首先,同步請求是不能取消的。其次,不管是隊列請求,還是簡單的非同步請求,全部調用[ request cancel ]來取消請求。取消的請求預設都會按請求失敗處理,並調用請求失敗delegate。如果不想調用delegate方法,則設定:[ request clearDelegatesAndCancel];隊列請求中需要注意的是,如果你取消了一個請求,隊列會自動取消其它所有請求。如果只想取消一個請求,可以設定隊列:[ queue
Time of Update: 2018-12-05
當程式接到記憶體警告時View
Time of Update: 2018-12-05
關於文本和Web的支援文本視圖UIKit架構提供三個顯示常值內容的基本類:UILabel 顯示靜態文本字串UITextField 顯示單行可編輯文本UITextView 顯示多行可編輯文本雖然標籤和文本編輯框通常用於顯示相對少量的文本,但實際上這些類可以顯示任意數量的文本。在使用可編輯的文本視圖時,您必須提供一個委託對象,負責管理編輯會話。文本視圖會向委派物件發送幾個不同的通告,讓它知道編輯何時開始,何時結束,並使它有機會重載某些編輯動作。Web視圖除了顯示內容,您還可以用web視圖對象來顯示w
Time of Update: 2018-12-05
loadView,viewDidLoad,viewDidUnload,這三個函數到底應該怎麼用?Google一下,全是轉載,大概內容是這樣:loadView 手動載入viewviewDidLoad用於nib檔案載入後,進一步處理viewDidUnload是viewDidLoad的鏡像參考官方文檔,我給出糾正:一、loadView永遠不要主動調用這個函數。view
Time of Update: 2018-12-05
UITableView的- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation這一方法會重新載入所指定indexPaths中的UITableViewCell執行個體,因為重新載入cell所以會請求這個UITableView執行個體的data
Time of Update: 2018-12-05
NSString *str = [NSString stringWithFormat:@"http://itunes.apple.com/us/app/id%d", 436957167];[[UIApplication sharedApplication] openURL:[NSURL urlWithString:str]];其中,436957167是appid 附:跳轉到評價頁面:NSString *str = [NSString stringWithFormat: @"itms-apps:
Time of Update: 2018-12-05
contentSize是scrollview可以滾動的地區,比如frame = (0 ,0 ,320 ,480) contentSize = (320 ,960),代表你的scrollview可以上下滾動,捲動區域為frame大小的兩倍。contentOffset是scrollview當前顯示地區頂點相對於frame頂點的位移量,比如上個例子你拉到最下面,contentoffset就是(0
Time of Update: 2018-12-05
NSString * aa = [[NSString alloc] init];NSLog(@"%d",[aa retainCount]);輸出:-1 (_NSCFConstantString *)NSString * aa = [NSString string];NSLog(@"%d",[aa retainCount]);輸出:-1 (_NSCFConstantString *) NSString * aa = [[NSString
Time of Update: 2018-12-05
lement元Size (in points)大小Window (including status bar)視窗(包括狀態列)320 x 480 pts Status Bar狀態列( How to hide the status bar ) ( 如何隱藏狀態列 )20 pts View inside window查看裡面的視窗(visible status bar) (可見狀態列)320 x 460 Navigation Bar導覽列44 pts Nav Bar Image
Time of Update: 2018-12-05
通常在建立完UITableViewController後,會看到UITableViewDataSource的一個實現函數如下- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {static NSString *CellIdentifier = [NSString stringWithFormat:@"Cell"];
Time of Update: 2018-12-05
1 : 如果無法保證子類行為的一致性,那麼就用委託If the subClass can't keep with superClass,use delegate rather than inheritance. 2: 屏 幕上看到的,都是 UIVewEverything you see on Screen is UIView. 3: 如 果對效能要求高,慎用 Interface Build(Xcode 4.2.1已經變了,冒似沒有Interface Builder的概念了)if
Time of Update: 2018-12-05
CATransition *transition = [CATransition animation]; transition.duration = 1.0f;//間隔時間 transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];//動畫的開始與結束的快慢 /* kCATransitionFade;
Time of Update: 2018-12-05
iPhone OS為建立高品質的圖形提供兩種路徑:即通過OpenGL進行渲染,或者通過Quartz、Core Animation、和UIKit進行渲染。UIKit的圖形系統在iPhone OS上,所有的描畫—無論是否採用OpenGL、Quartz、UIKit、或者Core