偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

iPhone應(yīng)用開(kāi)發(fā)之學(xué)習(xí)點(diǎn)滴

移動(dòng)開(kāi)發(fā) iOS
本文主要講解的是在iphone開(kāi)發(fā)學(xué)習(xí)中積累起來(lái)的小知識(shí),主要是對(duì)類(lèi)的操作,來(lái)看詳細(xì)內(nèi)容。

iPhone應(yīng)用開(kāi)發(fā)中學(xué)習(xí)點(diǎn)滴是本文要介紹的內(nèi)容,主要介紹了IPhone之NSBundle的使用、IPhone之ASINetworkQueue 異步隊(duì)列、IPhone之獲取Settings設(shè)置的內(nèi)容,來(lái)看本文內(nèi)容詳解。

IPhone之NSBundle的使用

NSBundle的對(duì)象可以獲取應(yīng)用程序安裝目錄的附件。

附件包括了,當(dāng)前應(yīng)用程序下,所有的文件。(圖片、屬性列表等)

獲取XML文件

  1. NSString *filePath = [[NSBundle mainBundle] pathForResouse:@"re" ofType:@"xml"];  
  2. NSData *data = [[NSData alloc] initWithContentsOfFile:filePath];   

獲取屬性列表

  1. NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle]   
  2. pathForResource:@"ViewControllers" ofType:@"plist"]]; 

IPhone之ASINetworkQueue 異步隊(duì)列

使用NSOperationQueue(或ASINetWorkQueue,見(jiàn)下面示例)將給你對(duì)異步request更多的控制。當(dāng)使用隊(duì)列的時(shí)候,只有確定數(shù)量的request可以同時(shí)運(yùn)行。如果你添加的request超過(guò)了隊(duì)列的maxConcurrentOperationCount屬性,request將在其他request運(yùn)行完了之后運(yùn)行。

注:ASINetworkQueue 類(lèi)查看前面的IPhone之ASIHTTPRequest簡(jiǎn)介

  1.     //異步獲取圖片 ASINetworkQueue queue = [[ASINetworkQueue alloc] init];  
  2. for (ForumItem *item in itemList)  
  3.  {  
  4. //item.Image 圖片的地址  
  5. if (item.Image)   
  6. {  
  7. ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURLURLWithString:item.Image]];  
  8. request.userInfo = [NSDictionary dictionaryWithObject:item.ImageforKey:@"Image"];  
  9. [request setDelegate:self];  
  10. [request setDidFinishSelector:@selector(requestDidFinished:)];  
  11. [queue addOperation:request];  
  12. }  
  13. }  
  14. [queue go]; 

最后記的釋放:queue

IPhone之獲取Settings設(shè)置

IPhone中,可以用NSUserDefaults類(lèi)讀取用戶(hù)設(shè)置。NSUserDefaults在尖用程序中只有一個(gè)實(shí)例在運(yùn)行。獲取代碼如下:

Key的值為 Root.plist中的Key值

  1. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];  
  2. [defaults objectForKey:@"username"];  
  3. [defaults objectForKey:@"password"];  
  4. [defaults objectForKey:@"protocol"];  
  5. [defaults objectForKey:@"warp"];  
  6. [[defaults objectForKey:@"warpFactor"] stringValue];  

小結(jié):iPhone應(yīng)用開(kāi)發(fā)之學(xué)習(xí)點(diǎn)滴的內(nèi)容介紹完了,通過(guò)本文介紹的IPhone之NSBundle的使用、IPhone之ASINetworkQueue 異步隊(duì)列、IPhone之獲取Settings設(shè)置的內(nèi)容,希望在你學(xué)習(xí)中能幫助到你。

責(zé)任編輯:zhaolei 來(lái)源: 互聯(lián)網(wǎng)
相關(guān)推薦

2011-08-08 10:10:14

iPhone開(kāi)發(fā) 圖片 方法

2011-07-27 11:14:37

iPhone UITableVie

2011-07-27 10:13:23

Cocos2D iPhone

2011-08-09 17:29:29

iPhone文件屏幕

2011-07-28 15:11:23

iOS Objective-

2011-08-18 10:39:46

iPhone開(kāi)發(fā)界面

2011-08-08 14:57:46

iPhone Autoreleas Property

2011-08-15 17:38:48

iPhone開(kāi)發(fā)調(diào)試工具

2011-08-09 17:12:30

iPhoneCFRunLoop

2011-08-19 11:10:31

iPhone應(yīng)用

2011-08-12 09:48:24

iPhoneCoreLocatio定位

2011-08-15 18:02:32

iPhone開(kāi)發(fā)表視圖

2011-08-02 14:35:11

IOS應(yīng)用

2011-08-10 10:10:21

iPhoneUIPopoverCo

2011-08-08 16:56:44

iPhone 字符處理 視圖

2011-07-08 14:58:16

iPhone Xcode iOS

2011-07-19 09:58:36

2011-07-19 09:46:38

2011-08-15 10:06:22

iPhone開(kāi)發(fā)nib 文件

2011-08-01 18:27:58

iPhone開(kāi)發(fā) UISearchBa
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)