Time of Update: 2015-05-15
IOS開發之新浪微博OAuth2 說明:微博開放介面的調用,如發微博、關注等,都是需要擷取使用者身份認證的。目前微博開放平台使用者身份鑒權主要採用的是OAuth2.0。為了方便開發人員開發、測試自己的應用。 OAuth2.0較1.0相比,整個授權驗證流程更簡單更安全,也是未來最主要的使用者身分識別驗證和授權方式。步驟一:建立應用下面我以本公司測試帳號為例,建立應用步驟可以參考新浪的官方API
Time of Update: 2015-05-13
IOS基礎-UIImageViewUIImage是定義一張圖片,而UIImageVIew是定義一個視圖,然後把圖片放進去 - (void)viewDidLoad{ [super viewDidLoad];// UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"1"]
Time of Update: 2015-05-13
IOS基礎-UITextFieldUITextField通常用於外部文字輸入,就是常見的輸入框.如下用代碼詳細說明UITextField的各種屬性和方法 - (void)viewDidLoad{ [super viewDidLoad]; //文本輸入框 UITextField UITextField *textField = [[UITextField alloc] init]; /
Time of Update: 2015-05-13
IOS基礎-UIProgressViewUIProgressView和UIActivityIndicator有些類似 但是不同之處在於,UIProgressView能夠更加精確的反應進度UIActivityIndicator則只能表示事物在進行中 有一個例子是在Mail程式中當在下載資訊的時候,有一個UIProgressView顯示在底部 - (void)viewDidLoad{ [super
Time of Update: 2015-05-13
IOS基礎-UILabel最普通的文字標籤, 說白了就是一個字串的集合,來展示文本用的。如下詳細說明了label的各種屬性 - (void)viewDidLoad{ [super viewDidLoad]; UILabel *label = [[UILabel alloc] init]; //設定顯示的文字
Time of Update: 2015-05-11
Objective-C Protocols,objective-cObjective-C Protocols 1.1 Formal Protocols A formal protocol (like an informal protocol) is a named list of methods and properties.formal protocol (像informal protocol)是一系列方法和屬性的名字列表。However, a formal protocol
Time of Update: 2015-05-08
完美方案——iOS的WebView自適應內容高度,ioswebview /////////////////////////////初始化,self.view是父控制項///////////////////////////////// _webView = [[UIWebView alloc] initWithFrame: CGRectMake(0, 0, self.view.frame.size.width, 0)]; _webView.delegate = self;
Time of Update: 2015-05-07
應該直接學Swift還是Objective-C? 蘋果在2014年的WWDC大會上發布了Swift語言之後,很多初學者都有一個共同的疑問,
Time of Update: 2015-05-08
iOS 刪除NSString中特定字元+(NSString *) stringDeleteString:(NSString *)str{ NSMutableString *str1 = [NSMutableString stringWithString:str]; for (int i = 0; i < str1.length; i++) { unichar c = [str1 characterAtIndex:i]; NSRange range =
Time of Update: 2015-05-07
【Cocos2d-Js基礎教學(4)cocostudio在cocos2dx-Js中的使用】,cocos2dxcocostudio首先我們開啟官方網站www.cocos2d-x.org,下載我們安裝最新的cocostudio(cocos)。簡介:Cocos Studio升級為cocos。更優秀的產品、更優質的服務。遊戲開發一站式解決方案,
Time of Update: 2015-05-07
UIView的位置與尺寸,UIView位置尺寸 設定frame屬性值時使用CGRectMake,設定center屬性值時使用CGPointMake. UILabel *label=[[UILabel alloc]initWithFrame:CGRectZero]; //frame的設定 label.frame=CGRectMake(0, 0, 200, 50);
Time of Update: 2015-05-07
iOS下載網狀圖片-(void)setWebImage:(NSURL *)aUrl placeHolder:(UIImage *)placeHolder downloadFlag:(int)flag{dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{//配置下載路徑NSString *path=[NSHomeDirectory() stringByAppendingFormat:@"
Time of Update: 2015-05-07
iOS-響應上下左右滑動手勢-(void)viewDidLoad{ UISwipeGestureRecognizer *recognizer;recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)];[recognizer
Time of Update: 2015-05-06
Xcode 新版本如何設定ARC,xcode新版本arc在剛剛開始學習IOS開發時,最好不要開啟ARC,這樣有助於學習記憶體管理,但不少剛剛接觸Xcode的朋友可能會發現,當你使用最新版本的Xcode時,敲入release等代碼時會提示報錯。這是因為系統預設使用自動記憶體管理,下面就簡單說明下如何設定這個ARC。註解:IOS 5.0以後,xcode4.2之後 //ARC(auto reference
Time of Update: 2015-05-06
iOS軟鍵盤遮擋UITableView內文字框問題1、註冊UIKeyboardDidShowNotification/UIKeyboardDidHideNotification通知。-(id) initWithNibName:(NSString*)nibNameOrNil bundle:nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { //
Time of Update: 2015-05-05
給view添加類似系統上拉捷徑功能表的手勢,view手勢iOS7以後從螢幕最下方上劃會滑出捷徑功能表,感覺這個效果不錯,就想做個類似的效果,這個東西技術含量不高,每次都寫一遍的話就太浪費時間了,所以就把它寫成了一個分類,用起來會方便一點。demo地址:https://github.com/Phelthas/TEST_XMLCommon使用效果如下:(註:動畫使用了facebook的pop) 實現方案:1,用分類的方式給view添加了一個 -
Time of Update: 2015-05-04
iOS中Block介紹(一)基礎,iosblock介紹基礎iOS中Block介紹(一)基礎一、概述Block是C層級的文法和運行時特性。Block比較類似C函數,但是Block比之C函數,其靈活性體現在棧記憶體、堆記憶體的引用,我們甚至可以將一個Block作為參數傳給其他的函數或者Block。二、熱身先看一個比較簡單的Block例子:int multiplier = 7; int (^myBlock)(int) = ^(int
Time of Update: 2015-05-04
ios筆記-NSSet//// main.m// NSSet//// Created by Passer-by on 15-3-23.// Copyright (c) 2015年 MAC. All rights reserved.//#import int main(int argc, const char * argv[]){ @autoreleasepool {
Time of Update: 2015-05-04
iOS擷取類的屬性列表通過執行個體講解: @interface DemoObject : NSObject@property (strong, nonatomic,readonly) NSString *name;@property (strong, nonatomic) NSMutableArray *dataSource;@property (copy, nonatomic) NSDictionary *product;@property (assign, atomic)
Time of Update: 2015-05-04
IOS開發反射和動態調用總結和java一樣,Object-C也提供了反射的機制。每一個類都有一個Class,擷取Class有以下三種方法。 // insert code here... //通過字串擷取class Class clazz = NSClassFromString(@"NSString"); NSLog(@"clazz的類型是%@",clazz); //直接用calzz