Time of Update: 2015-06-12
事件的傳遞及相應者鏈條,事件傳遞鏈條 除去高大上的標題,本文主要就是講當你觸碰手機螢幕上任意點的時候,系統是怎樣找到那個需要響應該觸碰事件的控制項,以及該控制項對觸碰事件的響應情況 首先是
Time of Update: 2015-06-12
IOS開發中設定導覽列主題,ios開發導覽列主題/** * 系統在第一次使用這個類的時候調用(1個類只會調用一次) */+ (void)initialize{ // 設定導覽列主題 UINavigationBar *navBar = [UINavigationBar appearance]; // 設定背景圖片 NSString *bgName = nil; if (iOS7) { // 至少是iOS 7.0 bgName = @"NavBar64"
Time of Update: 2015-06-10
第二回《iOS之Block淺析》,iosblock回調======================================================================| 轉載須註明部落格地址:http://www.cnblogs.com/devappnow ||
Time of Update: 2015-06-10
【Swift】TTTAttributedLabel使用小記,tttattributedlabel前言 TTTAttributedLabel繼承自UILabel,很方便基於現有代碼進行修改,Star超過4K+,今天用了一下作點筆記。 聲明 歡迎轉載,但請保留文章原始出處:) 部落格園:http://www.cnblogs.com農民伯伯: http://over140.cnblogs.com 環境Xcode 6.3.3Cocoapods 0.37.
Time of Update: 2015-06-10
iOS tableView的圖片緩衝非同步載入1.建立一個viewController..h檔案實現UIScrollViewDelegate和UITableViewDelegate,並聲明ICTableViewDelegate(用來實現圖片有緩衝則載入圖片,無緩衝則請求圖片並緩衝下來再載入) .h檔案如下#define KimageKey @"photoFileUrl" ///為數組中每個item中存放圖片URL的key名字#define KidKey
Time of Update: 2015-06-09
iOS 註冊本地通知(推送)註:按Home鍵讓App進入後台運行時,方可查看通知。 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {// Override point for customization after application launch. //
Time of Update: 2015-06-09
iOS推送
Time of Update: 2015-06-08
UITextField輸入中文限制,uitextfield輸入中文 [self.textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; 輸入改變的時候監聽限制輸入- (void)textFieldDidChange:(UITextField *)tex
Time of Update: 2015-06-05
#IOS-navigation中左滑pop的三種方法IOS-navigation中左滑pop的三種方法系統內建pop方法如果我們沒有對navigation中的back按鈕進行自訂,我們可以直接使用系統內建的左滑pop方法。但是如果我們對back按鈕,進行了自訂,我們就要對self.navigationController.interactivePopGestureRecognizer這個屬性進行設定了。關鍵代碼__weak typeof(self) weakSelf =
Time of Update: 2015-06-04
Objective-C的內省(Introspection),introspection內省(Introspection)是物件導向語言和環境的一個強大特性,Objective-C和Cocoa在這個方面尤其的豐富。通過內省可以動態查詢類中聲明的屬性以及屬性的名稱和類型。內省是對象揭示自己作為一個運行時對象的詳細資料的一種能力。這些詳細資料包括對象在繼承樹上的位置,對象是否遵循特定的協議,以及是否可以響應特定的訊息。NSObject協議和類定義了很多內省方法,用於查詢運行時資訊,以便根據對象的特徵進
Time of Update: 2015-06-05
ios怎麼判斷日期是周末?- (NSString *)calculateWeek:(NSDate *)date{ //計算week數 NSCalendar * myCalendar = [NSCalendar currentCalendar]; myCalendar.timeZone = [NSTimeZone systemTimeZone]; NSInteger week = [[myCalendar components:NSWeekdayCalendarUnit
Time of Update: 2015-06-05
[iOS]圖片壓縮&儲存View為內容Img1、圖片的壓縮封裝類方法+ (UIImage*)imageWithImageSimple:(UIImage*)image scaledToSize:(CGSize)newSize{ // Create a graphics image context UIGraphicsBeginImageContext(newSize); // Tell the old image to draw in this new
Time of Update: 2015-06-03
ios FMDB初體驗之增刪改查又又好久沒見了。想你們。今天寫一篇關於fmdb的使用文章。在工作中,我們有時會用到資料庫,所以你會需要一個好用的工具。長話短說開始進入正題。先匯入fmdb庫檔案。還有就是加入libsqlite3.dylib。這2個前期準備好後,我們就可以開工了。#import "ViewController.h"#import "FMDB.h" //匯入標頭檔@interface ViewController
Time of Update: 2015-06-01
iOS開發筆記3:XML/JSON資料解析,iosjson 這篇主要總結在iOS開發中XML/JSON資料解析過程用到的方法。XML資料解析主要使用SAX方式的NSXMLParser以及DOM方式的GDataXML,JSON資料解析主要使用NSJSONSerialization。 1.XML解析之NSXMLParser
Time of Update: 2015-06-01
[oc學習筆記]字串,oc學習筆記字串 1 //建立字串 2 NSString *str1 = [NSString string]; 3 //建立c字串 4 NSString *str2 = [NSString stringWithCString:"ss" encoding:NSUTF8StringEncoding]; 5 //用字串建立字串 6 NSString *str3 = [NSString
Time of Update: 2015-05-31
IOS -擷取當前視圖的Controller擷取當前視圖的TopViewController AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; UIViewController* topViewController = appdelegate.baseTabBarController.navigationController.topViewController;
Time of Update: 2015-05-31
iOS APP互相調用調用者:只需要執行以下調用方法,以“://”為分隔字元,左邊就是要調用APP的地址,右邊是你要傳給這個APP的參數。 NSURL *url = [NSURL URLWithString:@"Ceshi001://aaaaaaa"]; [[UIApplication sharedApplication] openURL:url]; 被調用者:info.plist檔案中添加URL
Time of Update: 2015-05-31
即時通訊UI-聊天介面(UITableView顯示左右兩人聊天),ui-uitableview目錄1.建立UITableView對象並設定相關屬性2.建立cellModel模型//枚舉類型typedef enum { ChatMessageFrom = 0,//來自對方的訊息 ChatMessageTo //發給對方的訊息 }ChatMesageType;#import <Foundation/Foundation.h>@interface
Time of Update: 2015-05-31
iOS_字串顯示不同顏色最近寫代碼需要根據不同的內容顯示不同的顏色。在這裡mark一下。設定顏色: NSString *contentStr = @"簡介:hello world"; NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithString:contentStr]; //設定:在0-3個單位長度內的內容顯示成紅色 [str
Time of Update: 2015-05-30
IOS檢測指定路徑的檔案是否存在 本文給大家分享的是在IOS開發中檢測指定檔案是否存在的方法,給大家匯總了4種,十分實用,小夥伴們根據自己的需求自由選擇吧。 代碼如下: - (NSString *)dataPath:(NSString *)file { NSString *path = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]