Time of Update: 2018-12-07
前面一片文章介紹了如何上傳和下載檔案,這篇文章將介紹一下如何在iOS裝置中進行緩衝。這篇文章將只介紹一下將內容緩衝到記憶體中,下一篇文章就介紹一下在iOS磁碟上緩衝內容。使用緩衝的目的是為了使用的應用程式能更快速的響應使用者輸入,是程式高效的運行。有時候我們需要將遠程web伺服器擷取的資料緩衝起來,減少對同一個url多次請求。記憶體緩衝我們可以使用sdk中的NSURLCache類。NSURLRequest需要一個緩衝參數來說明它請求的url何如快取資料的,我們先看下它的CachePolicy類型
Time of Update: 2018-12-07
程式開發過程中,有時候需要代碼共用,但是不想讓其他程式員看到共用程式碼邏輯,和更改共用程式碼。這就需要我們自己製作靜態類庫了,使用靜態類庫有以下好處:1、在保護原始碼的基礎上,跟他人共用代碼。2、可以減少編譯的時間。下面是製作靜態類庫的過程:1、首先,建立工程staticLibary。2、添加靜態類庫到Targets中。添加new taget。選擇static Library,添加名字為example。3、添加靜態類StaticText。targets中選擇example。#import
Time of Update: 2018-12-07
『iOS學習筆記』 - 變數 屬性 方法 實現 1、代碼說明:Person.hPerson.h#import <Foundation/Foundation.h>@interface Person : NSObject{ int age,sex;//變數的定義 int height,width;}@property int age,sex;//屬性的定義@property char height;//-(void) setAge;-(int) setAge1
Time of Update: 2018-12-07
『iOS學習筆記』 UIButton-1 UIButton /// UIButton //建立UIButton UIButton *tmpButton =[[[UIButton alloc] init]autorelease]; //設定背景顏色 tmpButton.backgroundColor = [UIColor blueColor]; //設定標題文本 [tmpButton setTitle:@"MyButton"
Time of Update: 2018-12-07
『iOS學習筆記』 類型轉換失敗(use of undeclared identifier)下面這句話為何拋錯:use of undeclared identifier, -(void)request{ NSObject *otherBizData = [iLoginViewController callAddBiz]; NSObject *otherRequestData = [iLoginViewController callAdd];
Time of Update: 2018-12-07
代碼的目的是根據一個UIImage產生對應的灰化(黑白)UIImage.以下代碼源自stackoverflow裡的一個回複,可惜原文連結已經找不到了。- (UIImage*) convertImageToGreyScale:(UIImage*) image{ // Create image rectangle with current image width/height CGRect imageRect = CGRectMake(0, 0, image.size.width,
Time of Update: 2018-12-07
更改“2011-12-09T14:58:36+08:00”格式的日期 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setLocale:[[[NSLocale alloc]initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]]; [dateFormatter
Time of Update: 2018-12-07
曆史NeXSTEPMany years ago Cocoa was known as NeXTSTEP . NeXT Computer developed and released version 1.0 ofNeXTSTEP in September of 1989, and versions 2.0 and 3.0 followed not far behind (in 1990 and 1992,respectively). In this early phase, NEXTSTEP
Time of Update: 2018-12-07
Book DescriptionThe authors of the bestselling Beginning iPhone 3 Development are back, with the same excellent material completely updated for iOS 4 and written from the ground up using the latest version of Apple’s Xcode 3. All source code has
Time of Update: 2018-12-07
KVC運用了一個isa-swizzling技術。isa-swizzling就是類型混合指標機制。KVC主要通過isa- swizzling,來實現其內部尋找定位的。isa指標,如其名稱所指,(就是is a kind of的意思),指向維護分發表的對象的類。該分發表實際上包含了指向實作類別中的方法的指標,和其它資料。 比如說如下的一行KVC的代碼:[site setValue:@"sitename" forKey:@"name"];就會被編譯器處理成:SEL sel =
Time of Update: 2018-12-07
掃描wifi資訊:http://code.google.com/p/uwecaugmentedrealityproject/http://code.google.com/p/iphone-wireless/條碼掃描:http://zbar.sourceforge.net/iphone/sdkdoc/install.htmltcp/ip的通訊協議:http://code.google.com/p/cocoaasyncsocket/voip/sip:http://code.google.com/p/
Time of Update: 2018-12-07
已經很大歲數的人了,因為項目的需要,開始ios的開發。 開始使用 macbook,感覺一切都是新的,一個菜鳥坐在漂亮的macbook前。 office沒有了(office for mac有點難用啊)、喜歡的IME沒有了、網銀不能用了、鍵盤也不習慣......唉,彆扭。下載 xcode,免費,呵呵,這個不錯。開始買書 objective c、ipad開發、iphone開發..... 看到objective
Time of Update: 2018-12-07
os提供了對通訊錄操作的組建,其中一個是直接操作通訊錄,另一個是調用通訊錄的UI組建。實現方法如下:添加AddressBook.framework到工程中。代碼實現: -(IBAction)onClickbutton:(id)sender { NSMutableArray* personArray =[[[NSMutableArray alloc] init] autorelease]; ABAddressBookRef addressBook
Time of Update: 2018-12-07
在iphone實現彈出框視圖一文中已經介紹了怎麼添加彈出框,下面在這個的基礎上,在彈出框中填入table資訊,並且使用者可以實現多選資訊。實現的結果:實現過程是在彈出框中添加table資訊,點擊前面的選取框,按鈕更換圖片,並且把相應的內容添加到相應的數組中,用於資料處理。主要的實現代碼:#import "TableViewCell.h"@implementation TableViewCell@synthesize
Time of Update: 2018-12-07
在XE4中編寫完程式後,怎麼把相應的檔案部署到ios虛擬機器和真實機子中呢?下面就來說說。首先選擇你要部署的項目,選擇Project-》Deployment菜單Deployment菜單開啟如下通過按鈕把程式所需要的資料檔案載入進來,在Remote Path中設定的值為StartUp\Documents。因為代碼中取出該檔案的路徑的代碼是begin{$IFDEF IOS} UniConnection1.database:= GetHomePath + PathDelim +
Time of Update: 2018-12-07
參考外包網站上的一個點餐系統的部分需求寫著練手,主要使用了以下知識:完整源碼下載:/Files/0771bc/Hotel.zip1. Tabbar Controller與 Navigation Controller的套用2. TableViewCell 子視圖添加UILabel和UIButton等3. Quartz 2D 繪製自訂視圖4. 手勢結合UIView Animation切換視圖5. CoreData 及其資料的初始化方法6. 使用HTTP Get/Post Request
Time of Update: 2018-12-07
多線程開發是一件需要特別精心的事情,即使是對有多年開發經驗的工程師來說。為了能讓初級開發工程師也能使用多線程,同時還要簡化複雜性。各種編程工具提供了各自的辦法。對於iOS來說,建議在儘可能的情況下避免直接操作線程,使用比如NSOperationQueue這樣的機制。可以把NSOperationQueue看作一個線程池,可往線程池中添加操作(NSOperation)到隊列中。線程池中的線程可看作消費者,從隊列中取走操作,並執行它。你可以設定線程池中只有一個線程,這樣,各個操作就可以認為是近似的順序
Time of Update: 2018-12-07
作為一種輕量級的資料交換格式,json正在逐步取代xml,成為網路資料的通用格式。有的json代碼格式比較混亂,可以使用此“http://www.bejson.com/”網站來進行JSON格式化校正(點擊開啟連結)。此網站不僅可以檢測Json代碼中的錯誤,而且可以以視圖形式顯示json中的資料內容,很是方便。從IOS5開始,APPLE提供了對json的原生支援(NSJSONSerialization),但是為了相容以前的ios版本,可以使用第三方庫來解析Json。本文將介紹TouchJson、S
Time of Update: 2018-12-07
iOS framework 製作教程,這次不是靜態包!!! 我們使用一種變通的方法來製作 iOS framework,廢話不多說,上步驟:1.開啟Xcode建立一個“Cocoa Touch Static Library”工程,並刪除現有的target.2.右鍵project選擇添加New Target,在彈出的視窗中找到Cocoa ,在Cocoa右側視窗中選擇“Loadable Bundle”。注意:到這步的時候不要選擇framework,應為framework是MAC
Time of Update: 2018-12-07
步驟:1.在info.plist裡加入UIBackgroundModes鍵,其值為數組,數組之一為voip字串:<key>UIBackgroundModes</key><array><string>voip</string></array>2.在程式啟動的時候調用- (void)setupBackgroundHandler函數,函數體如下:#pragma mark - VoIP-