Time of Update: 2014-12-13
OC處理.Net Json時間格式,ocjson 通過伺服器收到的json時間格式是/Date(xxxxxxxxxxxxx+xxxx)/,其中前半部分是自1970年的millionSecs,後半部是時區,我們需要對齊進行轉換。 解決方式有兩種,第一種就是在服務端將時間轉換為字串再發送,那樣在IOS端直接用NSDateFormater就能獲得時間 如果你對服務端沒選擇的話,就要自己轉換了 只要明白xxxxxxxxxxxxx+xxxx的格式的意義我們就有思路了
Time of Update: 2014-12-13
iOS UITableView中非同步載入圖片 - 解決方案問題背景:需要在UITableView中的每一行下載圖片,之前使用placeholder,下載好後存在cache中。 解決方案:方案一: 如何安裝及使用在git頁面有詳細解釋,具體使用的代碼: #import ...- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
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
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
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-06
SQLite 終端相關命令,sqlite終端命令 SQLite ALLLast login: Fri Dec 5 09:52:08 on ttys002BeSilent:~ qianfeng$ sqlite3 data.dbSQLite version 3.7.13 2012-07-17 17:46:21Enter ".help" for instructionsEnter SQL statements terminated with a
Time of Update: 2014-12-08
自動滾動,自動顯示下一個映像,滾動,自動顯示映像:每隔1s會自動切換映像和小白點。 工程圖:代碼:RootViewController.h#import <UIKit/UIKit.h>@interface RootViewController : UIViewController<UIScrollViewDelegate,UIPageViewControllerDelegate>{ UIScrollView *imageScrollView;
Time of Update: 2014-12-05
LTBounceSheetDemo(仿退出登入),手機qq怎麼退出登入點擊任何處:點擊“取消”或“退出”的:工程圖:代碼:RootViewController.h #import <UIKit/UIKit.h>//加入標頭檔#import "LTBounceSheet.h"//define檔案#define color [UIColor colorWithRed:0/255.0 green:175/255.0 blue:240
Time of Update: 2014-12-06
黑蘋果安裝教程(一),蘋果安裝教程一。下載鏡像和相關軟體二。將鏡像寫入隨身碟三。安裝鏡像: 1.將隨身碟插入USB介面。 2.重啟電腦,於此同時狂按F12,進入隨身碟安裝。 彈出介面:Boot Menu:ATAPI CD1:PLDS DVD-RW DS8A9SH ATA HDDO:TOSHIBA MQO1ABF050 USB HDD(硬碟驅動): PCI LAN:Realtek PXE B04 D00
Time of Update: 2014-12-06
[iOS基礎控制項,ios基礎控制項A.需求1.類似於微博內容的展示2.頭像3.名字4.會員標誌5.內容6.分割線7.配圖(可選,可有可無) 1 // 2 // ViewController.h 3 // Weibo 4 // 5 // Created by hellovoidworld on 14/12/4. 6 // Copyright (c) 2014年 hellovoidworld. All rights reserved. 7 // 8 9 #import
Time of Update: 2014-12-03
擷取裝置型號,擷取裝置 代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. NSLog(@"--self-machine-%@",[self machineName]); }- (NSString*) machineName{ struct utsname systemInfo;
Time of Update: 2014-12-03
IOS 多線程/GCD多線程 —單利+ (SingleHandel *)shareModel{ static dispatch_once_t onceQueue; dispatch_once(&onceQueue, ^{ shareSingle = [[SingleHandel alloc] init]; }); return shareSingle;}/* //第一種線程開啟方式 NSThread *thread1 =
Time of Update: 2014-12-03
iOS開發- iPhone6/6 Plus適配花了點時間, 重新整理了下iPhone的相關適配, 總結如下:iOS6之前, 螢幕適配一般使用autosize,設定視圖與父視圖的尺寸關係缺陷:(Autosizing布局的不足)1. 不能設定視圖與視圖之間的關係2. 不能設定尺寸放大,縮小的最大值,最小值iOS6之後, 使用自動布局。AutoLayoutiOS8 size classes (更加抽象, 正方形)另外, 現在主流的一些裝置參數如下:
Time of Update: 2014-12-03
iOS開發 - post / get 詳解一。 區別從表面的意思看get 和 post的區別get就是擷取資料,post就是發送資料。這個是誤區。其實兩者都可以的,在IOS向伺服器發送請求裡面可以帶參數。那麼這些誤區是怎麼出現的呢?先看看一下對http的解釋一般在瀏覽器中輸入網址訪問資源都是通過GET方式;在FORM提交中,可以通過Method指定提交方式為GET或者POST,預設為GET提交
Time of Update: 2014-12-03
ios之開發螢幕適配和系統版本適配ios軟體開發過程中很重要的一點是對系統和螢幕進行適配對系統的適配主要是IOS7以後和之前以及IOS8新增特性,螢幕適配主要是對不同裝置採用不同的布局以最佳展示效果展現給使用者。針對系統的適配:IOS7以後和之前#define IOSVersion [[[UIDevice currentDevice] systemVersion] floatValue]#define IsiOS7Later
Time of Update: 2014-12-02
根據size截取螢幕中間矩形地區,size截取螢幕矩形代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)];
Time of Update: 2014-12-02
UIActionSheet動態添加按鈕,uiactionsheet動態:代碼://點擊任何處,彈出UIActionSheet-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UIActionSheet *sheet=[[UIActionSheet alloc]initWithTitle:@"標題" delegate:self cancelButtonTitle:nil
Time of Update: 2014-11-25
iOS
Time of Update: 2014-11-21
iOS 7 UI 過渡指南 - 支援續 iOS 6(iOS 7 UI Transition Guide - Supporting iOS 6)iOS 7 UI Transition GuidePreparing for TransitionBefore You StartScoping the ProjectSupporting iOS 6Updating the UIAppearance and BehaviorBars and Bar ButtonsContent