Time of Update: 2015-01-06
iOS NSURLSession的使用,iosnsurlsession1.NSURLSessionDataTask 1 // 確定URL 2 NSString *urlStr = @"http://localhost/試試看"; 3 urlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 4 NSURL *url = [NSURL
Time of Update: 2015-01-06
IOS用戶端Coding項目記錄(一),ios用戶端coding項目1:UITextField設定出現清除按鍵self.textField.clearButtonMode =
Time of Update: 2014-12-31
iOS產生UUID //內連,使用方式較多下使用, static inline NSString * GetUUIDString(){CFUUIDRef uuidObj = CFUUIDCreate(nil);NSString *uuidString = (__bridge_transfer NSString*)CFUUIDCreateString(nil, uuidObj);CFRelease(uuidObj);return uuidString;} //類方法,
Time of Update: 2014-12-30
iOS瘋狂詳解之視頻播放MPMoviePlayerViewController需要匯入的架構#import MediaPlayer.framework MPMoviePlayerViewController:開啟網路視頻:-(void)openmovie{MPMoviePlayerViewController *movie =
Time of Update: 2014-12-30
iOS中block的使用詳解第一、block的使用1、截獲自動變數的值typedef void(^TEST)(void);int main(int argc, const char * argv[]) { @autoreleasepool { TEST test; NSString *sample=@"hello"; test=^{ NSLog(@"%@",sample); };
Time of Update: 2014-12-26
ios 中內容label高度自適應首先並且最重要的是計算文本高度,然後再設定label的高度,計算文本高度:假設文本: NSString*strtest
Time of Update: 2014-12-26
IOS之表視圖添加搜尋欄,ios表視圖
Time of Update: 2014-12-25
iOS block用法最近在學習的過程中遇到一個問題,整個項目用UINavigationController作為根控制器,某一個表試圖控制器使用了自訂的UITableViewCell,該類cell有自訂的幾個按鈕,當點擊cell的任何一個按鈕時需要知道當前是哪個cell以及哪個按鈕被點擊然後做相應的事件響應(更改該行資料,頁面跳轉等),之前用過代理,這一次想換一種方式,所以選擇了用塊來代替,下面列出詳細步驟1.在自訂的cell標頭檔中申明塊,並定義相應的塊類型#import @class
Time of Update: 2014-12-25
圖文混排(HBLabelDemo), :工程目錄圖:代碼:此工程需要引入第三方庫HBLabelviewController.m#import "ViewController.h"//加入標頭檔#import "HBLabel.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any
Time of Update: 2014-12-23
Objective-C之類的三大特性:封裝,繼承,多態(1)我們都知道,物件導向程式設計中的類有三大特性:繼承,封裝,多態,這個也是介紹類的時候,必須提到的話題,那麼今天就來看一下OC中類的三大特性:一、封裝封裝就是對類中的一些欄位,方法進行保護,不被外界所訪問到,有一種許可權的控制功能,Java中有四種存取權限修飾符:public,default,protected,private存取權限依次遞減,這樣我們在定義類的時候,哪些欄位和方法不想暴露出去,哪些欄位和方法可以暴露,可以通過修飾符來完成
Time of Update: 2014-12-18
[iOS基礎控制項,ios基礎控制項A.概念1.移動app非常容易受到其他的系統、軟體事件的幹擾,如來電、鎖屏2.app受到幹擾的時候,UIApplication會通知delegate,來代理處理幹擾事件3.delegate可以處理的事件(1)app聲明周期(啟動、關閉)(2)系統事件(來電)(3)緊急事件(記憶體警告) B.使用稱為delegate的條件:遵守UIApplicationDelegate協議項目開始會自動建立:AppDelegate 1 -
Time of Update: 2014-12-17
ios開發中類方法與self的注意點 與執行個體方法區別Objective-C裡面既有執行個體方法也類方法。類方法(Class Method) 有時被稱為Factory 方法(Factory Method)或者方便方法(Convenience method)。Factory 方法的稱謂明顯和一般意義上的Factory
Time of Update: 2014-12-15
螢幕滾動控制項ScrollView的使用,滾動控制項scrollview1.UIScrollView有2個子類,uitextview和uitableview,這兩個控制項經常需要用到,因此熟練掌握它的使用是很有必要的。它們都是在內容超出螢幕時,可以提供水平或垂直捲軸。 2.主要的3個屬性,contentSize、contentInset和contentOffset。 2.1
Time of Update: 2014-12-13
IOS
Time of Update: 2014-12-13
iOS瘋狂詳解之中如何添加應用自己的字型1.第一步找到你想用的字型的 ttf 格式。加入到你的工程的resouce目錄下。2.在工程的plist中AddRow,“Fonts provided by application” ,然後添加key為item0,value為你剛才加入的testFont.ttf 。是這樣,可以添加多個,使用的時候寫對應字型名字就行。3.在你的工程就可以直接用了。xx.font = [UIFont fontWithName:@testFont
Time of Update: 2014-12-13
iOS瘋狂詳解之UITableView的全選和多選功能多選做法如下:- (void)tableView:(UITableView *)tableViewdidSelectRowAtIndexPath:(NSIndexPath *)indexPath{ [tableViewdeselectRowAtIndexPath:indexPath animated:YES]; Custom *cell= (Custom*)[tableView
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
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-10
iOS耳機操作,ios耳機iOS在7之後增加的麥克風許可權的申請,代碼如下:123456789101112AVAudioSession *avSession = [AVAudioSession sharedInstance];if ([avSession respondsToSelector:@selector(requestRecordPermission:)]) { [avSession requestRecordPermission:^(BOOL available) {