IOS開發一些常用功能

1 點擊背景時關閉鍵盤在viewDidLoad中添加手勢辨識器// add tap gesture recognizer UITapGestureRecognizer* tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self

iOS網路狀態檢測

從Git庫下載https://github.com/tonymillion/Reachability把兩個檔案Reachability.h 和 Reachability.m檔案添加到工程中。添加架構支援SystemConfiguration.framework添加標頭檔聲明:@class Reachability;@interface AppDelegate : UIResponder <UIApplicationDelegate>{

iOS 中的單元測試與持續整合

Unit Test 工具1、OCUnit:從 xcode 2.1 開始整合到開發環境中,使用方便,不需要引入額外的庫。並可以配置 xcodebuild,實現在命令列測試,從而在 CI 中進行測試與報告。2、GTM 的單元測試部分:對 OCUnit 進行了擴充,增加了一些宏。地址:https://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting3、GHUnit:帶有一個獨立的 GUI。地址:https://github.

iOS 擷取GUID

- (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);   

xmppframework for iOS client(三) 添加好友

添加好友代碼初始化xmppStream _xmppStream = [[XMPPStreamalloc] init];    //[_xmppStream setEnableBackgroundingOnSocket: YES];    [_xmppStreamaddDelegate:selfdelegateQueue:dispatch_get_main_queue()];    //    _xmppRosterDataStorage =

iOS 擷取系統資訊

 float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue];//iOS SystemVersion[[UIDevice currentDevice] name]); // Name of the phone as named by user [[UIDevice currentDevice] uniqueIdentifier]); // iOS5.0 及其以後這個方法已經被禁止使用。再繼續使用的後果是“

ios全域變數使用

ios全域變數使用1、使用靜態變數2、使用單例類3、把全域變數設定到AppDelegate中去例: 定義和使用一個全域變數"isLogin"AppDelegate.h@interface AppDelegate :UIResponder <UIApplicationDelegate>@property (strong,nonatomic)UIWindow *window;@propertyBOOL isLogin;@endAppDelegate.m@implementation

iOS學習筆記1 – 版本控制

本文記錄一個自開始開發以來,基本和.NET與SQL打交道的傢伙開始學習iOS的經過。由於是學習中,不可避免的肯定會有很多疏漏。由於現在工作的主要項目不是iOS開發,更新可能會比較慢,每次可能也只更新一點點。大概可以成為反面教材吧。1. 版本控制Mac下,git有github的官方的工具,用起來還行。不過svn就比較悲慘了。XCode內建的更新到1.6.18後就停止了,導致我只要一開啟公司的svn項目就被提示svn版本不夠高。(也有一說是OSX 10.8根本不內建svn,見http://blog.

實現 iOS 應用自動編譯

前段時間開發了一個簡單的 Web 應用程式,主要用來自動編譯 iOS 應用,簡化 iOS 應用的發布難度。由於編譯任務的密集計算部分主要由編譯器承擔,我們所需要做的只是一個商務邏輯的粘合,因此選用開發語言與架構的首要考慮點為:開發效率高。基於上面的基本原則選用的開發庫與架構如下:Mac 內建的 Python 2.6.1,64 位元模式Mac 下 pysvn 1.7.5,64 位元模式Mac 下 MySQL-Python 1.2.3,64 位元模式Mac 下 libxml2-python 2.6.

檢查你的iOS程式是否正在被調試

下面這個 C 函數可以用來檢測你的程式是否正在被調試: static bool debuggerRunning(void){ int junk; int mib[4]; struct kinfo_proc info; size_t size;  info.kp_proc.p_flag = 0;  mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2]

在 iOS 中如何發簡訊

從 iOS MFMessageComposeViewController,可以用來發簡訊。用法:MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];picker.messageComposeDelegate = self;picker.recipients = [NSArray arrayWithObjects:@"1234", @"2345",

PNG compression and iOS apps

ref:http://bjango.com/articles/pngcompression/At face value, running your images through a tool like ImageOptim seems like a great idea. It grinds away, shaving kilobytes or bytes off each file, hopefully helping your app download and launch faster.

如何在iOS應用中撥打到電話,並讓使用者確認

在應用中撥打到電話,可以參考如下的程式碼片段:// This will dial a call without prompting the user[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:1-800-555-1212"]];但是在撥打到電話前給使用者一個提示是比較友好的,參考如下程式碼片段(在iOS5.0下):NSString *number = @"telprompt://1-800-555-1

iOS & Max_OS_X Debugging Magic

iOS: http://developer.apple.com/library/ios/#technotes/tn2239/_index.htmlMac OS X: http://developer.apple.com/library/ios/#technotes/tn2004/tn2124.html===============================================================Debugging Objective-C with

行動裝置:air開發ios的典型步驟

AIR for iOS以下步驟是開發用於 iOS 的 AIR 應用程式的典型步驟:安裝 iTunes。在 Apple iOS Provisioning Portal 上產生必需的開發人員檔案和 ID。這些項目包括:開發人員認證應用程式識別碼供給設定檔在建立供給設定檔時,必須列出您計劃要安裝應用程式的任意測試裝置的 ID。將開發認證和私密金鑰轉換為 P12 keystore 檔案。編寫應用程式 ActionScript 或 MXML 代碼。利用 ActionScript 或 MXML

IOS中 自訂訪問使用者Location時的提示資訊

IOS中,必須經過使用者同意才能訪問使用者的地理位置(CLLocationManager),這一過程是由系統控制的,在第一次請求時為自動詢問使用者,如果能夠向使用者展示自己使用座標的原因,而非惡意訪問,使用者體驗會好很多。CLLocationManager有一個purpose的屬性,通過它就可以在請求中加上自己的資訊,這個屬性從ios 3.2開始就有了。 CLLocationManager *_locmanager = [[CLLocationManager alloc] init];

仿IOS Launch 歡迎介面

Activity 介面:welcome_layout.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

ios 動態監聽鍵盤IME和高度

    //監聽鍵盤高度變化    [[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(keyboardWasChange:) name:UIKeyboardDidChangeFrameNotificationobject:nil];    - (void)keyboardWasChange:(NSNotification *)aNotification {    NSLog(@"Keyboard

ios學習之xcode到處ipa安裝包

1、連結真機 2、將編譯形式改release 3、選擇工作列上的product中的archive4、跳出該頁面,選擇自己應用這裡是第一個(高亮的那個)5、然後選擇右側的Distribute按鈕6、跳出新介面,這個介面是選擇到處什麼檔案,第一個選項是上傳到appstore,第二個是企業匯出到本地7、選擇認證使用者,這裡選的不認證 8、儲存ipa安裝包的名字,然後next就ok了  

IOS開發(63)之GCD執行延遲操作

1 前言 使用Dispatch_after ,能夠在你想指定一定數量的延遲之後,使用 GCD 來執行代碼。今天我們就來學習一下。 2 代碼執行個體Demo1:ZYAppDelegate.m - (void) printString:(NSString *)paramString{ NSLog(@"%@", paramString);}- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:

總頁數: 703 1 .... 566 567 568 569 570 .... 703 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.