Time of Update: 2015-07-22
OC,中山oc @interface Car : NSObject{ @public int _wheels; int _speed;} - (void)run; @end @implementation Car - (void)run{ NSLog(@"%d個輪子, 速度為%d的車子跑起來了", _wheels,
Time of Update: 2015-07-22
iOS學習--網路基礎,ios--網路基礎Get & Post請求•網路訪問的四個步驟–地址–請求–串連–處理結果•iOS網路處理常用類–NSURL(地址)–NSRequest[GET]&
Time of Update: 2015-07-22
ios開發之電子優惠券的設計與實現//// main.m// 電子優惠券//#import #import Discount.h#import Food.hint main(int argc, const char * argv[]){ Discount * dis = [[Discount alloc]init]; [dis showInformation:20 andDiscountTime:@本優惠券每日上午10:30之後使用
Time of Update: 2015-07-17
iOS開發,ios開發教程Core DataCore Data是iOS5之後才出現的一個架構,它提供了對象-關係映射(ORM)的功能,即能夠將OC對象轉化成資料,儲存在SQLite資料庫檔案中,也能夠將儲存在資料庫中的資料還原成OC對象。在此資料操作期間,我們不需要編寫任何SQL語句,這個有點類似於著名的Hibernate持久化架構,不過功能肯定是沒有Hibernate強大的。傳統的資料庫要把資料寫到資料庫,而且要寫SQL語句 Core Data
Time of Update: 2015-07-16
iOS KVC(Key-Value Coding)常見使用方法:擷取值valueForKey: 根據屬性名稱取值 valueForKeyPath: 根據路徑取值(如:[person valueForKeyPath:@”car.price”]) valueForUndefinedKey 預設實現是拋出異常,可以重寫這個函數做錯誤處理 ( 比較少用 ) 修改值setValue:forKey: 根據屬性設值 setValue:forKeyPath: 根據路徑設值
Time of Update: 2015-07-15
XMPP增加移除朋友,xmpp增加好友 在現階段的通訊服務中,各種標準都有,因此會出現無法實現相互連通,而XMPP(Extensible Message and presence Protocol)協議的出現,實現了整個及時通訊服務協議的互連。有了這個協議之後,使用任何一個組織或者個人提供的即使通訊服務,都能夠無障礙的與其他的及時通訊服務的使用者進行交流。例如google 公司2005年推出的Google
Time of Update: 2015-07-13
iOS
Time of Update: 2015-07-13
圖層的一些基本動畫效果,圖層動畫效果#define kRadianToDegrees (radian) (radian * 180.0) / (M_PI)//閃爍[self.testView.layer addAnimation:[self opacityForever_Animation:0.5] forKey:nil];//移動[self.testView.layer addAnimation:[self duration:3 move:[NSNumber
Time of Update: 2015-07-15
下拉彈出列表選擇項效果,下拉彈出列表 右邊菜單中的按鍵,點擊彈出一個列表可選擇,選擇其中一個,響應相應的事件並把文字顯示在右邊的菜單上;彈出下拉效果使用LMDropdownView外掛程式,可以用POD進行載入pod
Time of Update: 2015-07-11
Xcode中常用的快速鍵,Xcode常用快速鍵各種建立shift + comand + n 建立xcode項目 option + command + n 建立分組 command + n 建立檔案 搜尋 shift + command + o command + f 控制tabcommand + t 建立tabcommand + w 關閉tab控制視窗的顯示隱藏comand + 0 隱藏顯示導航視窗comand + 1 。。。。n
Time of Update: 2015-07-11
IOS開發—自訂多選相簿自訂多選相簿主要思路匯入AssetsLibrary架構 從資產庫中擷取擷取資源群組【0】,過濾【1】照片後在列表中顯示組。 點擊資源群組進入對應的相簿中,擷取組中的所有照片資源【2】【0】擷取資源群組[_assetsLibrary enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) { if (group) {
Time of Update: 2015-07-11
iOS Block使用 #import
Time of Update: 2015-07-11
instancetype和id的異同,instancetype異同1、相同點都可以作為方法的傳回型別2、不同點instancetype可以返回和方法所在類相同類型的對象,id只能返回未知類型的對象;instancetype只能作為傳回值,不能像id那樣作為參數,比如下面的寫法:- (void)setName:(instancetype)name{ // do something }上面這個是錯誤的應該是這樣的- (void)setName:(id)name{ // do
Time of Update: 2015-07-11
一句話實現OC單例模式,一句話實現OC模式首先建立一個標頭檔,定義如下宏:// .h檔案的實現#define SingletonH(methodName) + (instancetype)shared##methodName;// .m檔案的實現#if __has_feature(objc_arc) // 是ARC#define SingletonM(methodName) \static id _instace = nil; \+ (id)allocWithZone:(struct
Time of Update: 2015-07-08
簡單的倒計時效果,簡單倒計時效果 - (void)viewDidLoad { [super viewDidLoad]; [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerMethod:) userInfo:nil repeats:YES];} - (void)timerMethod:(NSTimer *)timer{
Time of Update: 2015-07-08
Masonry基本使用,Masonry使用在學習過程中,通過同學瞭解到了這個自動布局第三方架構-MasonryMasonry是一個輕量級的布局架構,使用簡潔的代碼來代替冗長、繁瑣的AutoLayout代碼。本文章只是對Masonry的基本使用,對於Masonry的具體內容可參考以下兩篇技術部落格,本人也是在這兩篇文章的瞭解下才使用的:Masonry介紹與使用實踐(快速上手Autolayout):http://adad184.com/2014/09/28/use-masonry-to-quick-
Time of Update: 2015-07-08
【學習筆記】【OC語言】第一個OC程式,學習筆記oc 1.#import的用途: 1> 跟#include一樣,拷貝檔案的內容 2> 可以自動防止檔案的內容被重複拷貝 2.#import <Foundation/NSObjCRuntime.h> NSObjCRuntime.h中有NSLog函數的聲明 3.Foundation架構標頭檔的路徑 1>
Time of Update: 2015-07-08
iOS 處理方法中的可變參數## iOS 處理方法中的可變參數最近寫了一個自訂的對話方塊的demo,想模仿系統的UIAlertView的實現方式,對處理可變參數的時候,遇到了小問題,於是Google了一下,寫下了處理問題的方法,記錄下來,以備後需。代碼實現- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate
Time of Update: 2015-07-08
iOS多線程編程之NSOperationNSOperation有兩種方法:1>.NSInvocationOperation:建立一個operation,並用selecter指向執行的程式碼片段2>.NSBlockOperation:建立一個operation,並將執行的代碼放在block塊中.1.NSInvocationOperation多線程方法:建立方法: - (void)invocationOperation {NSInvocationOperation
Time of Update: 2015-07-08
iOS 類增加成員變數RT// 增加成員變數#import @interface NSObject (AddProperty)@property (nonatomic,strong) NSString *stringProperty;@property (nonatomic,assign) NSInteger integerProperty;@end#import NSObject+AddProperty.h#import