Time of Update: 2018-12-04
引用計數式記憶體管理的思考方式:自己產生的對象,自己所持有。非自己產生的對象,自己也可以持有。不再需要自己持有的對象時釋放。非自己持有的對象無法釋放。對象操作Objective-c方法產生並持有對象alloc/new/copy/mutableCopy方法持有對象retain方法釋放對象release方法廢棄對象dealloc方法Cocoa 架構中 Foundation 架構中的NSObject
Time of Update: 2018-12-04
這個頁面要講述的是使用者的粉絲列表,下面是:可以看到這個視圖明顯也是一個tableview,在每一個cell中包含的有三個部分的內容:粉絲頭像image,粉絲暱稱label,我和粉絲之間的相互關注情況button。在這個頁面我們主要處理的內容有:① 粉絲列表資料的擷取
Time of Update: 2018-12-04
在 iPhone 或 iPad 的開發中,除了用 touchesBegan / touchesMoved /
Time of Update: 2018-12-04
建立一個user defaults方法有多個,最簡單得快速建立方法:NSUserDefaults *accountDefaults = [NSUserDefaults standardUserDefaults];添加資料到 user defaults:[accountDefaults setObject:nameField.text forKey:UserDefaultNameKey];也可以添加基礎資料型別 (Elementary Data Type)int, float,
Time of Update: 2018-12-04
http://hi.baidu.com/williamforfun/item/3b0ce2564a50d5afacc85796ios 與pc的資料互動 XML Webservice實現原理及相關知識好多書籍只介紹建立XML Webservice,並沒有詳細介紹XML WebService的工作原理以及各部分(例如IIS Asp.net)在XML WebService中所起的作用.學習後整理了一下,希望對讀者有所協助!(一).XML WebService作用 XML
Time of Update: 2018-12-05
http://blog.riaproject.com/objective-c/1745.htmliOS 4.1後加入了CMTime這個類別來設定時間 ,但是可憐的是Apple官方文間的說明實在是貧乏的可憐,只輕描淡寫寫了這段說明:CMTimeMake CMTime CMTimeMake ( int64_t value, int32_t timescale); Parameters value timescale Return Value Discussion Availability
Time of Update: 2018-12-05
轉載自:http://leopard168.blog.163.com/blog/static/168471844201111411729597/iOS 程式設計語言是 Objective-C, 簡稱 OC。 談起 OC的特性,人們常說,OC 不支援多繼承。但 Delegate 彌補了這個缺陷。 有了Delegate, 在聲明對象時,可以使其遵循多個協議。 從而解決了多繼承問題。 Delegate ,又稱為 委託或代理, 它是一種設計模式。
Time of Update: 2018-12-05
1、在做項目的時候經常發現IOS模擬器遇到慢動作,比如彈出一個UIAlertView,push到一個viewController,這個過程顯示的非常慢,而且Xcode控制台列印這樣一句話:Simulator slow-motion animations are now on還以為是模擬器假死,後面發現不是這樣的,是自己不小心觸發了某個動作。選中 IOS模擬器,然後連續按3次 shift 鍵,就恢複原來的速度了,並且控制台輸出:Simulator slow-motion animations
Time of Update: 2018-12-05
一、調用系統應用 1、調用app store介面方法在實際開發中,往往要推薦自己其他應用和推薦自己的收費軟體,那麼我們就需要在程式中直接連接到app store的相應頁面。 實際上的做法很簡單,使用的還是UIApplication類的OpenURL方法: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"程式的相應串連"]]; 1、調用其它應用的方法1)調用
Time of Update: 2018-12-05
IOS幾種簡單有效數組排序方法//第一種,利用數組的sortedArrayUsingComparator調用 NSComparator ,obj1和obj2指的數組中的對象NSComparator cmptr = ^(id obj1, id obj2){ if ([obj1 integerValue] > [obj2 integerValue]) { return (NSComparisonResult)NSOrderedDescending; } if
Time of Update: 2018-12-05
最近在做一個網路應用,收到xml是GBK編碼的,我用UTF8去編碼,結果返回nil的結果,明顯是編碼方法用錯了,得用GBK的編碼方式。方法如下:unsigned long encode = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);NSData *responseData = [request responseData];NSString *str = [[NSString alloc]
Time of Update: 2018-12-05
最近在做一個網路應用,收到xml是GBK編碼的,我用UTF8去編碼,結果返回nil的結果,明顯是編碼方法用錯了,得用GBK的編碼方式。方法如下:view plaincopy to
Time of Update: 2018-12-05
atomic和nonatomic用來決定編譯器產生的getter和setter是否為原子操作。 atomic 設定成員變數的@property屬性時,預設為atomic,提供多安全執行緒。 在多線程環境下,原子操作是必要的,否則有可能引起錯誤的結果。加了atomic,setter函數會變成下面這樣: {lock}
Time of Update: 2018-12-05
獲得所支援的語言NSUserDefaults *defaults = [ NSUserDefaults standardUserDefaults ]; // 取得 iPhone 支援的所有語言設定 NSArray *languages = [defaults objectForKey : @"AppleLanguages" ]; NSLog ( @"%@" , languages);運行,列印結果:( en, "zh-Hant", "zh-Hans", fr,
Time of Update: 2018-12-05
雖然iOS5完美越獄已經出現,在這裡也提供一個iOS
Time of Update: 2018-12-05
表格結構:NSEntityDescription 相當於資料庫中的一個表,TA描述一種抽象資料類型eg://+insertNewObjectForEntityForName:inManagedObjectContext: Factory 方法,根據給定的 Entity 描述,產生相應的 NSManagedObject 對象,並插入到 ManagedObjectContext 中Student *student = [NSEntityDescription
Time of Update: 2018-12-05
UINavigationController實現導航在App委託中的.h檔案裡@property( nonatomic ,strong)UINavigationController *nav;.m檔案裡@synthesize nav;-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.nav = [
Time of Update: 2018-12-05
1 25個增強iOS應用程式效能的提示和技巧(初級篇)http://www.cocoachina.com/newbie/tutorial/2013/0408/5952.html 2
Time of Update: 2018-12-05
typedef NS_OPTIONS(NSUInteger, UIRemoteNotificationType) { UIRemoteNotificationTypeNone = 0, UIRemoteNotificationTypeBadge = 1 << 0, UIRemoteNotificationTypeSound = 1 << 1, UIRemoteNotificationTypeAlert = 1 << 2
Time of Update: 2018-12-05
1.添加對應的自體檔案(.ttf或.otf等)到工程目錄下,比如:SIMKAI.TTF2.在-info.plist檔案中添加一項Fonts provided by application,item0對應的value為SIMKAI.TTF,多個自體依次添加即可。3.使用 [UIFont fontWithName: size:]來設定自體,fontWithName的參數不一定是SIMKAI,這個字型名字需要別的方法去查。查字型名字方法如下: for(NSString *familyName