原创 This is the original intention of this writing

In China,many people English is poor (this include me) ,I think that is reason people loses to use English in actu

原创 iOS筆記—SEL

對於SEL的簡單使用 // // main.m // selector // // Created by hhg on 15-6-17. // Copyright (c) 2015年 hhg. All rights res

原创 數據結構與算法--反序

OC中有已經封裝好的返序方法可以直接調用 NSArray * array = @[@"a", @"b", @"c",@"d"]; //正序 for (NSString * str in

原创 設計模式--命令

耦合: 簡單地說,軟件工程中對象之間的耦合度就是對象之間的依賴性。指導使用和維護對象的主要問題是對象之間的多重依賴性。對象之間的耦合越高,維護成本越高。因此對象的設計應使類和構件之間的耦合最小。 設計模式作用: 解決特定場合的耦合

原创 About cocoapods "xxx .h" file not found

When you finish the ‘pod install’ operation, an exception will be reported . you can try the following: Open the p

原创 設計模式--單例

單例是設計模式中常見的一種。 // // Singleton.h // 單例 // // Created by hhg on 15-6-11. // Copyright (c) 2015年 hhg. All rights

原创 iOS筆記—protocol

在OC中不能多繼承,但是可以實現多協議。使用協議,讓一個類必須(或選擇)實現一些方法。注:category也可以實現類似的作用,因此也叫非正式協議。我們來實現一個動物協議:// // Animal.h // // // Created

原创 數據結構--冒泡排序

OC和C方法混合版冒泡排序 // // main.m // // // Created by hhg on 15-6-15. // Copyright (c) 2015年 hhg. All rights reserved.

原创 iOS筆記—extension

extension像沒有命名的category。因此被稱爲:匿名類別,也叫類擴展 // // Person.h // 匿名類別 // // Created by hhg on 15-6-15. // Copyright (

原创 iOS筆記—成員變量的權限

// // Person.h // // // Created by hhg on 15-6-8. // Copyright (c) 2015年 hhg. All rights reserved. // #import <

原创 iOS筆記—@autoreleasepool

我們知道,release的作用是使對象引用計數-1。autorelease是系統自動在恰當的時候向對象發送一條release消息。 而autoreleasepool是在autorelease的基礎上將autorelease對象放入

原创 iOS筆記—NSData

NSData與NSString互轉 // // main.m // NSData // // Created by hhg on 15-6-11. // Copyright (c) 2015年 hhg. All right

原创 iOS筆記—property

property自動爲屬性生成setter和getter方法。以及能夠直接設置是否生成getter和setter方法。也能夠自定義setter和getter的方法名。 // // Person.h // property //

原创 iOS筆記—NSNumber

數組如果要存儲基本數據類型, 要將基本數據類型轉成對象。那麼就可以採用NSNumber將其轉化成對象保存。 // // main.m // // // Created by hhg on 15-6-18. // Copyri

原创 《編寫可讀代碼的藝術》筆記

概述: 編寫程序,如何讓程序持續可維護是一項難題。通過對代碼的可讀性優化,可以讓程序變得相對容易維護一些。因此,我們有必要研究研究代碼的可讀性。《編寫可讀代碼的藝術》這本書讀起來感覺不錯。花了大半天的時間通讀了一遍,隨手做了些筆記,