Time of Update: 2014-12-12
iOS代碼進行裝置螢幕判斷的最佳實務方案討論 目前開發的項目由於曆史原因均用代碼編寫UI,所以判斷裝置尺寸成了不可避免的任務。 目前我是這樣進行尺寸判斷的。 首先定義一個枚舉類,包含了所有的尺寸類型: // 螢幕尺寸的枚舉類型typedef NS_ENUM(NSUInteger, ScreenSizeType) { iPhone4Size, // 480 iPhone5Size, // 568 iPhone6Size, // 667 iPhone6pSize, // 736
Time of Update: 2014-12-12
IOS中十六進位的色彩轉換為UIColor 可用類別寫一個 方便使用 + (UIColor *) colorWithHexString: (NSString *)color { NSString *cString = [[colorstringByTrimmingCharactersInSet:[NSCharacterSetwhitespaceAndNewlineCharacterSet]] uppercaseString]; // String should be 6
Time of Update: 2014-12-12
[iOS基礎控制項,ios基礎控制項使用storyboard設計靜態表格式資料 A.實現步驟 1.控制器繼承UITableViewController 2.在storyboard中使用TableViewController,刪除原來的ViewController 3.設定class 4.設定新的View Controller為程式入口 5.設定TableView的Style為Grouped
Time of Update: 2014-12-12
iOS8 根據經緯度顯示地名 我們很多時候做項目的時候都選用通過手機擷取定位,然後傳資料給後台,這是iOS8根據經緯度顯示地名的demo //1.匯入架構 // // NearByViewController.m // nearDemo // // Created by apple on 14/12/5. // Copyright (c) 2014年 youdianshang. All rights reserved. // #import #import @
Time of Update: 2014-12-12
ios8系統定位問題 解決方案:1.在info.plist中添加key;NSLocationWhenInUseDescription,允許在前台擷取GPS的描述 NSLocationAlwaysUsageDescription,允許在後台擷取GPS的描述 %20%20%20%20%20%202.在代碼定位中,做版本區分和授權請求:if ([CLLocationManager locationServicesEnabled]){if
Time of Update: 2014-12-12
UIButton按鈕類的使用,uibutton按鈕類UIButton按鈕類的使用 我要說什麼?1. 什麼是按鈕2. 按鈕的基本使用 知識點詳解1. 什麼是按鈕? 如下如所示, 我們很多時候需要在讓使用者控制我們的應用, 一般可以使用按鈕 2. 按鈕的使用 //按鈕類UIButton的使用 //1.如何建立一個按鈕 //建立按鈕 UIButton *button = [UIButton
Time of Update: 2014-12-12
iOS 資料庫持久化,ios資料庫Java代碼 -(void) addObserver{ //當程式進入後台時執行操作 UIApplication *app&
Time of Update: 2014-12-12
ios開發過程中螢幕方向判斷的問題 Landscape 豎屏Portrait 橫屏最有效方法是:在willRotateToInterfaceOrientation:duration:方法中將方向儲存起來:DrviceOrientation =
Time of Update: 2014-12-10
iOS中遠程推送實現—在Apple的生產環境上測試Push Notifications功能,iosnotifications1、在“Provisioning Profiles”中點擊“Add”按鈕。2、在“What type of provisioning profile do you need?”頁面中選擇“Distribution”下的“Ad
Time of Update: 2014-12-12
iOS 運行時添加屬性和方法 第一種:runtime.h裡的方法BOOL class_addProperty(Class cls, const char *name, const objc_property_attribute_t *attributes, unsigned int attributeCount)#include <objc/runtime.h>#import
Time of Update: 2014-12-11
Quartz-2D繪圖之圖形上下文詳解,quartz-2d上下文 上一篇文章大概描述了下Quartz裡面大體所包含的東西,但是對具體的細節實現以及如何調用相應API卻沒有講。這篇文章就先講講圖形上下文(Graphics Context)的具體操作。 所謂Graphics Context,其實就是表示了一個繪製目標,也就是你打算繪製的地方,它包含繪製系統用於完成繪製指令的繪製參數和裝置相關資訊。Graphics
Time of Update: 2014-12-10
Arcgis API For IOS擴充AGSDynamicLayer新舊版API對比,arcgisiosAGSDynamicLayer(ForSubclassEyesOnly) Category ReferenceDescriptionThis category organizes the methods that are relevant to subclassing a dynamic layer. Developer can create custom dynamic layers
Time of Update: 2014-12-12
UIView的autoresizingMask屬性,autoresizingmask今天做相簿清單的時候,發現有些 UITableViewController 屬性不好記憶,然後就尋找了一些資料。做一下備份。在 UIView 中有一個autoresizingMask的屬性,它對應的是一個枚舉的值(如下),屬性的意思就是自動調整子控制項與父控制項中間的位置,寬高。 enum { UIViewAutoresizingNone = 0,
Time of Update: 2014-12-10
iOS耳機操作,ios耳機iOS在7之後增加的麥克風許可權的申請,代碼如下:123456789101112AVAudioSession *avSession = [AVAudioSession sharedInstance];if ([avSession respondsToSelector:@selector(requestRecordPermission:)]) { [avSession requestRecordPermission:^(BOOL available) {
Time of Update: 2014-12-10
IOS優秀部落格,ios部落格劍心的部落格資訊量很大,適合查閱和入門,學習完,你差不多就可以出山了,還有作為複習IOS的一些知識也挺好的。。。部落格地址:Kenshin Cui's
Time of Update: 2014-12-09
擷取iOS裝置資訊有時候做項目是需要擷取手機的相關資訊,好讓使用者知道自己的使用方式:鑌哥就直接寫代碼了 /* 擷取手機資訊 應用程式的名稱和版本號碼等資訊都儲存在mainBundle的一個字典中,用下面代碼可以取出來 */ NSDictionary* infoDict =[[NSBundlemainBundle] infoDictionary]; NSString* versionNum =[infoDict
Time of Update: 2014-12-09
iOS開發學習之#表視圖#(1)刪除行好久木有寫部落格了,前面學習的表視圖其他內容都木有寫,今天就從刪除行開始吧,希望自己能夠堅持下去。。加油(^ω^)。。廢話少說吧,,,直接上代碼:下面是刪除行的核心代碼:- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath
Time of Update: 2014-12-09
iOS UICollectionView手寫代碼實現步驟iOS UICollectionView手寫代碼實現步驟//// ViewController.h// collectionView手寫代碼//// Created by yangxiuying on 14/11/28.// Copyright (c) 2014年 lanjiying. All rights reserved.//#import @interface ViewController :
Time of Update: 2014-12-09
IOS鍵盤擋住UITextView的解決方案- (void)registerForKeyboardNotifications { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil]; [[NSNotificationCenter defaultCenter]
Time of Update: 2014-12-09
iOS開發:git命令返回任意一個版本的方法git回退某一個版本的方法:一:記錄回退的hash值首先要查看你要回退到哪一個版本方法1:git log會展示最新的提交記錄,然後你按著鍵盤的“向下”鍵,看更多的提交記錄,記住你要回退的哪一個版本的hash值方法2:git reflog 會展示最近操作的記錄,然後你記住要回退的hash值二:執行回退命令知道hash值之後,接下來就是指向回退命令了:git reset --hard