iphone 開發筆記二

2021-06-01 01:47:43 字數 1887 閱讀 6173

11、iphone中變數值是否等於字串的判斷方法:

objective-c**

[string1 isequaltostring:@

"123 "

];  

12、iphone的framework的目錄:

mac---developer---platforms---iphoneos.platform---developer---sdks---iphoneos3.1.3.sdk---system---library---frameworks

13、在iphone中設定googlemap的經緯度:

objective-c**

cllocationcoordinate2d centercoordinate;  

centercoordinate.latitude = 39.9097;  

centercoordinate.longitude = 105.3476;  

mkcoordinatespan span;  

span.latitudedelta = 30;  

span.longitudedelta = 30;  

mkcoordinateregion region;  

region.center = centercoordinate;  

region.span = span;  

[mapview setregion:region animated:true];  

14、翻頁過渡效果:

objective-c**

- (ibaction)backtomenus:(id)sender   

15、fathercontroller的寫法:

objective-c**

在.h中:  

#import "databasevc.h"

@class

databasevc;  

databasevc *databasevc;  

在.m中:  

databasevc = [[databasevc alloc] init];  

16、將nsdata型別的資料轉換成nsstring:

objective-c**

nsstring *thexml = [[nsstring alloc] initwithbytes: [webdata mutablebytes] length:[webdata length] encoding:nsutf8stringencoding]; 

//webdata為nsdata型別

17、將nsstring型別的資料轉換成nsdata:

objective-c**

nsdata *webdata = [nsmutabledata datawithbytes:[thexml utf8string] length:[thexml length]];; 

//thexml為nsstring型別

18、將特殊字元轉義:

objective-c**

nsstring *str2 = [str1 stringbyaddingpercentescapesusingencoding:nsutf8stringencoding];  

objective-c**

在p-list中新增如下內容:  

sbusesnetwork  3  

objective-c**

nsdateformatter *formatter = [[nsdateformatter alloc] init];  

[formatter setdateformat:@"yyyymmddhhmmss"

];  

nsstring *locationstring=[formatter stringfromdate: [nsdate date]]; 

iphone開發筆記

1 iphone的開發環境最好還是在mac os上進行,不過mac os是建立在free bsd openstep基礎上的,inux上邊很容易去建立開發環境,但是沒有mac os的xcode開發難度加大。2 iphone的使用的開發語言是obective c,它幾乎完全相容c的語法 不是c 3 雖然...

iPhone開發筆記

計算string串的畫素長度 1 cgsize pollabelsize polname sizewithfont uifont boldsystemfontofsize 16 constrainedtosize cgsizemake maxfloat,maxfloat 2 cgsize podla...

iPhone開發筆記(三)

11 iphone中變數值是否等於字串的判斷方法 objective c string1 isequaltostring 123 12 iphone的framework的目錄 mac developer platforms iphoneos.platform developer sdks iphon...