Time of Update: 2018-12-05
#include <CommonCrypto/CommonCryptor.h>+ (NSString*)Encrypte:(NSString*)src key:(NSString*)key{ NSString* retStr = nil; NSData* srcData = [src dataUsingEncoding:NSUTF8StringEncoding]; size_t dataOutAvilable = ([srcData length] +
Time of Update: 2018-12-05
在應用UIBUtton的時候我們有時需要同時設定圖片和文字,下面代碼僅供參考: UIButton *_backButton = [UIButtonbuttonWithType:UIButtonTypeCustom]; [_backButton setFrame:CGRectMake(12,8, 64, 28)]; [_backButton setTitle:@"返回"forState:UIControlStateNormal];
Time of Update: 2018-12-05
UIImagePickerController概述:UIImagePickerController
Time of Update: 2018-12-05
主要是使用MFMailComposeViewController 這個類,封裝下就ok. 1. 將ios的appDelegate類 的laungh函數中,將相應的代碼修改為:[cpp] view
Time of Update: 2018-12-05
1
Time of Update: 2018-12-05
。事件驅動iOS編程是基於事件驅動的。我們所要做的事情就是寫代碼響應相應的事件。 每當使用者操作應用程式時,裝置就會產生事件。例如當使用者點擊一個按鈕時,裝置就會產生一個相應的“觸擊”事件並發送給應用程式。事件不僅僅來自使用者的直接互動,像來電、電量不足、檔案下載完成等也會產生事件。實際上在IOS裝置上發生的任何事情最終都會產生一個或多個事件。當一個事件產生時,
Time of Update: 2018-12-05
1.擷取app的info.plist詳細資料版本號碼:Bundle version NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];應用標識:Bundle identifierNSString *bundleId = [[[NSBundle mainBundle] infoDictionary]
Time of Update: 2018-12-05
1.1 建立一個Single View app模版項目,命名為Localization。1.2 建立後,可以看到工作目錄結構檔案如下,單擊InfoPlist.strings,查看右邊的屬性,在Localization欄添加語言。 1.3 添加完成後開啟對應語言檔案,比如English的添加CFBundleDisplayName="China";Chinese檔案添加CFBundleDisplayName="中國";運行,如果此時你的模擬器是中文,你會看到你的程式名稱變成了
Time of Update: 2018-12-05
第一步 產生xmppstream對象 並且設定委託 _xmppStream = [[XMPPStreamalloc] init]; [_xmppStreamaddDelegate:selfdelegateQueue:dispatch_get_main_queue()];第二步 設定登陸帳戶名稱字與伺服器名字 NSString *userId = @"test1@mini.local";//登陸用的使用者名稱字NSString *server = @"mini.local";//@"127.0.
Time of Update: 2018-12-05
記憶體分區:1)、棧區(stack)— 由編譯器自動分配釋放 ,存放函數的參數值,局部變數的值等。其操作方式類似於資料結構中的棧。2)、堆區(heap) — 一般由程式員分配釋放, 若程式員不釋放,程式結束時可能由OS回收 。(ios中alloc都是存放在堆中)3)、全域區(靜態區)(static)—,全域變數和靜態變數的儲存是放在一塊的,初始化的全域變數和靜態變數在一塊地區, 未初始化的全域變數和未初始化的靜態變數在相鄰的另一塊地區。 -
Time of Update: 2018-12-05
首先看兩個runloop的樣本,來源:http://paste.lisp.org/display/86524第一個: #include <CoreFoundation/CoreFoundation.h> static void _perform(void *info __unused) { printf("hello\n"); } static void _timer(CFRunLoopTimerRef timer __unused, void *inf
Time of Update: 2018-12-05
基本原理就是主要將UIView的layer描繪到圖形上下文。UIView全域拍照和局域拍照的代碼如下:1 UIView全域拍照- (UIImage *) screenImage:(UIView *)view { UIImage *screenImage; UIGraphicsBeginImageContext(view.frame.size); [view.layer renderInContext:UIGraphicsGetCurrentContext()];
Time of Update: 2018-12-05
UIViewController顧名思義,視圖控制器應該在MVC設 計模式中扮演控制層的角色,類似Android中的Activity。UIViewController對應的View,可以定製xib,或者在UIViewController中的viewDidLoad方法動態產生。Xib(ios) Vs Layout(android)優點:所見即所得 (WYSIWYG),介面可完全通過GUI介面進行定製;由於xib與ViewControl之間的關聯是通過GUI操作,精簡了ViewControl的代碼;
Time of Update: 2018-12-05
找到應用程式的描述連結,比如:http://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8然後將 http:// 替換為 itms:// 或者 itms-apps://: itms://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8 itms-apps:// itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719
Time of Update: 2018-12-05
在iOS6以後Orientation可以在plist檔案裡面進行設定。設定項是“Supported interface orientations”。如果在iOS5或者一下版本UIViewController類預設支援Portrait only,要支援其他Orientation,需要重寫 shouldAutorotateToInterfaceOrientation:方法。- (BOOL) shouldAutorotateToInterfaceOrientation:
Time of Update: 2018-12-05
tyle="margin-top:20px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-family:'Courier New',Console,Verdana,微軟雅黑; font:normal normal normal 14px/26px
Time of Update: 2018-12-05
Iosapp升級版本步驟1.開啟地址https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa,登入進入2.選擇ManageYour App,選中你要升級的那個應用,會跳轉到這個應用的資訊介面3.在這個介面,currentVersion下面有你的應用icon,會顯示你的應用狀態,點擊右邊的addversion
Time of Update: 2018-12-05
1 questioniOS app is sandboxed, so if your app needs to open some file types in other apps, like dropbox app does, it could list the installed apps which could open specific types of file.How can you do that?, 2 answerYou'll want to
Time of Update: 2018-12-05
plist檔案是標準的xml檔案.A).寫入plist檔案:(Dictionary/Array)NSMutableDictionary* dict = [ [ NSMutableDictionary alloc ] initWithContentsOfFile:@"/Sample.plist" ];[ dict setObject:@"Yes" forKey:@"RestartSpringBoard" ];[ dict writeToFile:@"/Sample.plist"
Time of Update: 2018-12-05
小議iphone記憶體管理與屬性 一、前言 對於大多數從C++或者JAVA轉過來學習Object-C(以下簡稱OC)的人來說,OC這門語言看起來非常奇怪,用起來也有點麻煩。 OC沒有像JAVA一樣的記憶體回收機制,也就是說,OC編程需要程式員手動去管理記憶體。這就是為什麼它煩的原因,蘋果卻一直推崇開發人員在有限硬體資源內寫出最佳化的代碼,使用CPU最少,佔用記憶體最小。 二、基本原理對象的建立: