Time of Update: 2018-12-03
1,定義一個靜態全域的變數static Settings *sharedSettings = nil;2,建立一個類方法,用來返回該類執行個體+ (Settings *)sharedInstance { @synchronized(self){if(sharedSettings == nil){ sharedSettings = [[self alloc] init]; //做一些初始化操作 }
Time of Update: 2018-12-03
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerFireMethod:) userInfo:nil repeats:YES];//倒計時方法驗證碼實現倒計時60秒,60秒後按鈕變換開始的樣子-(void)timerFireMethod:(NSTimer *)theTimer { if (seconds == 1) { [theTimer
Time of Update: 2018-12-03
MD5密碼編譯演算法,實作類別別如下:#import <CommonCrypto/CommonDigest.h>@interface NSString (md5)-(NSString *) md5HexDigest;@end#import "NSString+MD5HexDigest.h"@implementation NSString (md5) -(NSString *) md5HexDigest{ const char *original_str = [self
Time of Update: 2018-12-03
1. Apple 開發人員指南,非常權威, 必備http://www.apple.com.cn/developer/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007072-CH1-SW12.
Time of Update: 2018-12-03
UILabel 的常見屬性和方法://建立UIlabel對象UILabel* label = [[UILabel alloc] initWithFrame:self.view.bounds];//設定顯示文本label.text = @"This is a UILabel Demo,";//設定文本字型label.font = [UIFont fontWithName:@"Arial" size:35];//設定文本顏色label.textColor = [UIColor
Time of Update: 2018-12-03
前幾天看到gitorious上有人移植了,但是下載連結打不開,於是clone了他的項目打算自己編譯。後來發現他是在mac上移植的,mkspec還要自己重新。借鑒了他的代碼,自己寫了mkspec,感覺比他寫得好。 編譯過程會遇到一些問題,只要是條件編譯問題,解決起來不難。最噁心的一個問題是編譯qlibraryinfo.cpp時出現如此錯誤[plain] view plaincopy{standard input}:4384:Expected comma after segment-name
Time of Update: 2018-12-03
在lion系統下使用sudo /Users/papabox/Downloads/cocos2d-iphone-2.0-rc1/install-templates.sh -f 命令安裝新版本cocos2d(cocos2d 2.0-rc1)的時候總是返回以下資訊:1 cocos2d-iphone template installer 2 3 Error: Do not run this script as root. 4 5 'root' is no longer supported 6 7
Time of Update: 2018-12-03
============================================================博文原創,轉載請聲明出處電子咖啡-專註於移動互連網============================================================網上download了一個demo,發現可以運行到模擬器,但是不能運行到真機,提示一下錯誤。/Users/UserName/Library/Developer/Xcode/DerivedData/xxx-beq
Time of Update: 2018-12-03
============================================================博文原創,轉載請聲明出處電子咖啡-專註於移動互連網============================================================我用代碼添加了UIBarButtonItem,但是結果如下:代碼: [items addObjectsFromArray:[NSArray
Time of Update: 2018-12-03
============================================================博文原創,轉載請聲明出處電子咖啡(原id藍岩)============================================================正常情況下,在AppDelegate中實現下面兩個方法,能夠監聽從後台恢複到前台- (void)applicationDidEnterBackground:(UIApplication *)application{
Time of Update: 2018-12-03
============================================================博文原創,轉載請聲明出處電子咖啡(原id藍岩)============================================================命令如下openssl x509 -in aps_development.cer -inform DER -out aps_development.pem -outform PEMopenssl pkcs12
Time of Update: 2018-12-03
============================================================博文原創,轉載請聲明出處電子咖啡(原id藍岩)============================================================記錄一下IOS開發中常用的路徑,備忘//這裡的“Mac”是對應的使用者名稱#模擬器中的app的安裝位置,包括app的檔案系統/Users/Mac/Library/Application
Time of Update: 2018-12-03
UI介面類項目:Panoramagl —— 720全景展示Panorama viewer library for iPhone, iPad and iPod touchMBProgressHUD —— 進度指示一種優雅的,半透明的進度顯示效果。同時還提供了其他附加功能,比如顯示完成資訊並淡出。iCarousel —— 效果很酷的分頁排列內容類別似的頁面需要並排列出來,供使用者選擇。iCarousel具有非常酷的3D效果,比如經典的CoverFlow,
Time of Update: 2018-12-03
============================================================博文原創,轉載請聲明出處電子咖啡(原id藍岩)============================================================IOS中沒有工具列,是和android的有一差別,不適應,現在我們自己來實現開關首先在你的資源裡面添加2張圖片,表示開、關的狀態,分別命名:switch_off.png,switch_on.png,下面上代碼,相信
Time of Update: 2018-12-03
============================================================博文原創,轉載請聲明出處電子咖啡(原id藍岩)============================================================最近在獲得路由ip地址時候遇到了麻煩,在iphone中我們可以從設定中看到網關地址,但是ios官方並不提供介面去獲得網關地址。最終自己做了demo來,已經上傳到github,地址:https://github.co
Time of Update: 2018-12-03
============================================================博文原創,轉載請聲明出處電子咖啡(原id藍岩)============================================================An NSString object represents a string of ordered characters (text). An NSCharacterSet object represents a
Time of Update: 2018-12-03
http://aasheaa.blog.163.com/blog/static/99333120126311332613/// 擷取當前裝置可用記憶體及所佔記憶體的標頭檔#import <sys/sysctl.h>#import <mach/mach.h> // 擷取當前裝置可用記憶體(單位:MB)- (double)availableMemory{ vm_statistics_data_t vmStats; mach_msg_type_number_t
Time of Update: 2018-12-03
IOS的推送認證,有有效期間限制,一般為一年。當我們認證到期的時候,就需要重建認證了。有一段時間沒有上蘋果網站了,昨天上去一看,此奧,改版了,下邊我們將重建一個正式環境的push推送的認證。1。先開啟鑰匙串(應用程式-工具 + 生產力-鑰匙串訪問),請求一個認證常用名稱寫為:2013.04.27_push_production_***。並儲存到磁碟上。2。進入開啟蘋果網站的認證標籤頁面,選擇 Identifiers標籤下邊的App
Time of Update: 2018-12-03
1. 首先進行搜尋CLLocationDistance radiusMeters = 1000; //設定搜尋範圍BMKSearch* search = [[BMKSearch alloc] init]; //建立搜尋對象search.delegate = self; //代理設定為自身,搜尋之後會自動回調下一步中的函數[search poiSearchNearBy:"KFC" center:mapView.centerCoordinate radius:radiusMeters
Time of Update: 2018-12-03
首先需要設定mapView的屬性:self.mapView = [[[BMKMapView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)] autorelease];//我們動態建立一個MapView對象mapView.showsUserLocation = YES;//可以顯示使用者當前位置mapView.zoomEnabled = YES;//允許ZoommapView.scrollEnabled =