Time of Update: 2018-12-05
方法一:http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html 方法二:http://forrst.com/posts/UIDevice_Category_For_Processes-h1H 方法三:http://stackoverflow.com/questions/3878197/is-it-possible-to-
Time of Update: 2018-12-05
UIAlertView 類似於Windows上 的MessageBox.一點小記錄,哎!現在是部落格控了,什麼都想記下,雖然簡單並且蘋果的相關技術文檔也有說明,還是寫下來。強迫症的初期表現出來啦。。。。貼代碼:一般的使用UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@"hello" message:@"I'm Apple"
Time of Update: 2018-12-05
從Git庫下載https://github.com/tonymillion/Reachability把兩個檔案Reachability.h 和 Reachability.m檔案添加到工程中。添加架構支援SystemConfiguration.framework添加標頭檔聲明:@class Reachability;@interface AppDelegate : UIResponder <UIApplicationDelegate>{
Time of Update: 2018-12-05
參考:http://www.cnblogs.com/duchengdong/archive/2012/03/30/2425300.html1、main() { int a[5]={1,2,3,4,5}; int *ptr=(int *)(&a+1); printf("%d,%d",*(a+1),*(ptr-1)); } 答案:2、5分析:*(a+1)即a[1],為2;&a+1不是首地址+1,系統會認為加一個a數組的位移,是位移了一個數組的大小(本例是5
Time of Update: 2018-12-05
參考網站:http://marshal.easymorse.com/archives/3296在iOS中有一些基本的設計模式:delegationprotocolmodel-vew-controllertarget-actionnotificationdeclared
Time of Update: 2018-12-05
- (NSString *)getUniqueStrByUUID{ CFUUIDRef uuidObj = CFUUIDCreate(nil);//create a new UUID //get the string representation of the UUID NSString *uuidString = (__bridge_transfer NSString *)CFUUIDCreateString(nil, uuidObj);
Time of Update: 2018-12-05
編譯模擬器版本1 到https://github.com/yuvi/gas-preprocessor下載gas-preprocessor.p並拷貝到/usr/sbin目錄中2 下載ffmpeg源碼。http://ffmpeg.org/download.htmlhttps://github.com/FFmpeg/FFmpeg3 解壓源碼,cd到源碼目錄下4 建立檔案config_i386.sh,其內容如下#!/bin/tcsh -fset targetDir="../ffmpeg-libs/i38
Time of Update: 2018-12-05
為了監聽伺服器是否有效,增加心跳監聽。用XEP-0199協議,在XMPPFrameWork架構下,封裝了 XMPPAutoPing 和 XMPPPing兩個類都可以使用,因為XMPPAutoPing已經組合進了XMPPPing類,所以XMPPAutoPing使用起來更方便。首先,匯入標頭檔 #import "XMPPAutoPing.h"聲明成員變數和屬性@interface XMPPConnectManeger : NSObject<XMPPAutoPingDelegate>{
Time of Update: 2018-12-05
添加好友代碼初始化xmppStream _xmppStream = [[XMPPStreamalloc] init]; //[_xmppStream setEnableBackgroundingOnSocket: YES]; [_xmppStreamaddDelegate:selfdelegateQueue:dispatch_get_main_queue()]; // _xmppRosterDataStorage =
Time of Update: 2018-12-05
ASIHTTPRequest 有很長時間停止了更新,對iOS5的支援不給力哦,所以以後就不用這個SDK了。官方地址:http://allseeing-i.com/ASIHTTPRequest/ AFNetworking有穩定的兩個主要負責人、能支援比較新的特性、一直有更新。但功能方面還不夠完整。git地址:https://github.com/AFNetworking/AFNetworking MKNetworkKit 支援ARC、一個印度阿三寫的。有
Time of Update: 2018-12-05
Google Maps SDK 使用介紹 https://developers.google.com/maps/documentation/ios/start按照資料介紹,step by step,so you can!!第一步,下載Google Maps SDK for iOS https://developers.google.com/maps/documentation/ios/start#getting_the_google_maps_sdk_for_ios第二步 擷取Google
Time of Update: 2018-12-05
float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue];//iOS SystemVersion[[UIDevice currentDevice] name]); // Name of the phone as named by user [[UIDevice currentDevice] uniqueIdentifier]); // iOS5.0 及其以後這個方法已經被禁止使用。再繼續使用的後果是“
Time of Update: 2018-12-05
首先下載xmppframework 地址: https://github.com/robbiehanson/XMPPFramework 點ZIP那個按鈕下載。 具體的操作方法參考:https://github.com/robbiehanson/XMPPFramework/wiki/GettingStarted_iOS這裡是最新的也是最詳盡的操作指南。詳細的操作步驟見說明文檔 。老外寫的step by step 真心給力啊!一步一步的按照操作去做保證沒問題。只是在添加KissXML
Time of Update: 2018-12-05
#include <objc/runtime.h> + (NSArray *)findAllOf:(Class)defaultClass{ int count = objc_getClassList(NULL, 0); if (count <= 0) { @throw@"Couldn't retrieve Obj-C class-list"; return [NSArray arrayWithObject:defaultClass]; }
Time of Update: 2018-12-05
ios全域變數使用1、使用靜態變數2、使用單例類3、把全域變數設定到AppDelegate中去例: 定義和使用一個全域變數"isLogin"AppDelegate.h@interface AppDelegate :UIResponder <UIApplicationDelegate>@property (strong,nonatomic)UIWindow *window;@propertyBOOL isLogin;@endAppDelegate.m@implementation
Time of Update: 2018-12-05
//對於錯誤資訊 NSError *error; // 建立檔案管理工具 NSFileManager *fileMgr = [NSFileManager defaultManager]; //指向檔案目錄 NSString *documentsDirectory= [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; //建立一個目錄
Time of Update: 2018-12-05
昨天開始接觸PHP沒學iOS,不過還是繼續寫用慣了Visual Studio後用XCode的人總會有各種抱怨,其中常見的一條就是:XCode的糟糕無比的code
Time of Update: 2018-12-05
本文記錄一個自開始開發以來,基本和.NET與SQL打交道的傢伙開始學習iOS的經過。由於是學習中,不可避免的肯定會有很多疏漏。由於現在工作的主要項目不是iOS開發,更新可能會比較慢,每次可能也只更新一點點。大概可以成為反面教材吧。1. 版本控制Mac下,git有github的官方的工具,用起來還行。不過svn就比較悲慘了。XCode內建的更新到1.6.18後就停止了,導致我只要一開啟公司的svn項目就被提示svn版本不夠高。(也有一說是OSX 10.8根本不內建svn,見http://blog.
Time of Update: 2018-12-05
首先補充說明一下,這個系列不是教程,所以除了很可能會出錯之外,而且不會按什麼由淺入深的順序來寫。寫什麼主題完全看心情。從C#轉到Objective-c開發之後,會產生這麼一個疑問:Objective-C似乎沒有命名空間?沒錯。C++和C#有namespace,Java有Package(當然和Namespace有差別),我最近開始寫的PHP也有如namespace
Time of Update: 2018-12-05
寫這篇的起因也是由於教材。在粗略地掃完Objective-C的教程後,就找了一本《Xcode 4 iOS Development Beginner’s