Time of Update: 2018-12-05
因為項目需要在UISwitch按鈕上寫文字,系統內建的UISwitch是這樣的:既不能寫字,也不能改顏色,於是在網上找到了這麼一個自訂的Switch按鈕,具體出處找不見了。記錄一下,怕以後找不見了。先看下:按鈕的樣式很多,可以文字,可以寫多行,文字大小和顏色都可以設定。看下它的源碼:#import <Foundation/Foundation.h>@interface HMCustomSwitch : UISlider {BOOL on;UIColor
Time of Update: 2018-12-05
1 點擊背景時關閉鍵盤在viewDidLoad中添加手勢辨識器// add tap gesture recognizer UITapGestureRecognizer* tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
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
繼上篇 iOS學習之iOS5.0以上 使用新浪微博開放平台OAuth過後,新浪微博授權彈出的網頁又有調整,中間還有過癱瘓情況。如果按上篇做出來的授權頁面就成這樣了:第一:網頁頁面變大了,第二:沒有了取消按鈕。根據這個情況在sina weibo SDK裡做了寫調整調整:增加一個關閉按鈕,快顯視窗大小。在WBAuthorizeWebView.m檔案的方法:bounceOutAnimationStopped裡添加按鈕:UIButton *closeButton = [UIButton
Time of Update: 2018-12-05
動畫效果提供了狀態或頁面轉換時流暢的使用者體驗,在iOS系統中,咱們不需要自己編寫繪製動畫的代碼,Core Animation提供了豐富的api來實現你需要的動畫效果。 UIKit只用UIView來展示動畫,動畫支援UIView下面的這些屬性改變:frame bounds center transform alpha backgroundColor contentStretch1、commitAnimations方式使用UIView動畫-
Time of Update: 2018-12-05
參考地址:http://www.axelbrz.com.ar/?mod=iphone-png-images-normalizer牛人寫了一個python指令碼恢複iOS程式中的png圖片。指令碼:ipin.py使用方法:1、把ipin.py放到要恢複的.png圖片一個目錄裡2、開啟終端,cd到此目錄。3、輸入 python ipin.py 4、根據提示資訊輸入 Y,斷行符號。這樣就能把圖片還原到可以查看了。#---# iPIN - iPhone PNG Images Normalizer v1
Time of Update: 2018-12-05
1、介紹
Time of Update: 2018-12-05
1、iOS程式名稱國際化1.1 建立一個Single View app模版項目,命名為Localization。1.2 建立後,可以看到工作目錄結構檔案如下,單擊InfoPlist.strings,查看右邊的屬性,在Localization欄添加語言。 1.3
Time of Update: 2018-12-05
xmpp檔案傳輸主要有兩種方法:1 socks5 bytestreams 對應的協議是XEP-00652 In-Band Bytestreams(ibb) 對應的協議是XEP-0047socks5 Bytestreams方法的優點是效率高,但是跨網段傳輸時需要一個檔案代理。像openfire伺服器就內建有檔案代理,所以這個容易實現。同網段傳輸可以直接連接,一般的實現是發起端建一個socks5服務。實際使用該方法時還需要使用XEP-0095協議來初始化流。XMPPFramework未包含XEP-0
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]; }