自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(367)
  • 收藏
  • 关注

原创 Effective Objective-C 2.0: Item 43: Know When to Use GCD and When to Use Operation Queues

Item 43: Know When to Use GCD and When to Use Operation QueuesGCD is a fantastic technology, but it is sometimes better to use other tools that come as part of the standard system libraries. Knowi

2013-12-12 21:54:01 1273

原创 Effective Objective-C 2.0: Item 42: Prefer GCD to performSelector and Friends

Item 42: Prefer GCD to performSelector and FriendsThanks to the extremely dynamic nature of Objective-C (see Item 11), a few methods defined on NSObject allow you to call any method you wish. Th

2013-12-12 21:32:57 1994

原创 Effective Objective-C 2.0: Item 41: Prefer Dispatch Queues to Locks for Synchronization

Item 41: Prefer Dispatch Queues to Locks for SynchronizationSometimes in Objective-C, you will come across code that you’re having trouble with because it’s being accessed from multiple threads. T

2013-12-12 21:14:16 5205

原创 Effective Objective-C 2.0: Item 40: Avoid Retain Cycles Introduced by Blocks

Item 40: Avoid Retain Cycles Introduced by Blocks Referencing the Object Owning ThemBlocks can very easily introduce retain cycles if they are not considered carefully. For example, the following

2013-12-12 20:41:46 1111

原创 Effective Objective-C 2.0: Item 39: Use Handler Blocks to Reduce Code Separation

Item 39: Use Handler Blocks to Reduce Code SeparationA common paradigm in programming a user interface is to perform tasks asynchronously. In this way, the thread that services user interface disp

2013-12-12 15:14:38 1237

原创 Effective Objective-C 2.0: Item 38: Create typedefs for Common Block Types

Item 38: Create typedefs for Common Block TypesBlocks have an inherent type; that is, they can be assigned to an appropriately typed variable. The type is made up of the parameters the block takes

2013-12-11 22:20:32 939

原创 Effective Objective-C 2.0: Item 37: Understand Blocks

Effective Objective-C 2.0介绍Blocks的文章,有些论点比较新颖,觉得不错,值得一看

2013-12-11 21:55:51 1778

原创 Effective Objective-C 2.0: Item 36: Avoid Using retainCount (Deprecated)

Item 36: Avoid Using retainCountObjective-C uses reference counting for memory management (seeItem 29). Each object has a counter that determines how many other things are interested in keeping

2013-12-11 15:29:33 1490

原创 Effective Objective-C 2.0: Item 35: Use Zombies to Help Debug Memory-Management Problems

Item 35: Use Zombies to Help Debug Memory-Management ProblemsDebugging memory-management issues can be painful. Sending a message to a deallocated object is completely unsafe, as one would expect.

2013-12-10 21:35:05 1496

原创 Effective Objective-C 2.0: Item 32: Beware of Memory Management with Exception-Safe Code

Item 32: Beware of Memory Management with Exception-Safe CodeExceptions are a language feature offered by many modern languages. Exceptions do not exist in pure C but do in both C++ and Objective-

2013-12-10 19:58:01 865

原创 Effective Objective-C 2.0: Item 31: Release References and Clean Up Observation State Only in deallo

Item 31: Release References and Clean Up Observation State Only in deallocAn object going through its life cycle eventually ends up being deallocated, which is where the dealloc method enters. I

2013-12-09 09:41:10 1339

原创 Effective Objective-C 2.0: Item 30: Use ARC to Make Reference Counting Easier

Item 30: Use ARC to Make Reference Counting EasierReference counting is a fairly easy concept to understand (see Item 29). The semantics of where retains and releases need to appear are easily e

2013-12-09 09:10:05 1351

原创 Effective Objective-C 2.0: Item 29: Understand Reference Counting

Item 29: Understand Reference CountingObjective-C uses reference counting for memory management, meaning that every object has a counter that is incremented and decremented. You increment the coun

2013-12-08 23:34:07 958

原创 Effective Objective-C 2.0: Class-Continuation Category == Class Extention

Item 27: Use the Class-Continuation Category to Hide Implementation DetailOften, you will want a class to contain more methods and instance variables than are exposed externally. You could expose

2013-12-08 20:41:35 1629

原创 Objective C 的 private

Instance variables declared in the implementation are implicitly hidden (effectively private) and the visibility cannot be changed - @public, @protected and @private do not produce compiler errors (

2013-12-08 17:16:44 926

原创 Effective Objective-C 2.0:Item 26: Avoid Properties in Categories

Item 26: Avoid Properties in CategoriesA property is a way of encapsulating data (see Item 6). Although it is technically possible to declare a property in a category, you should avoid doing so

2013-12-08 16:37:24 953

原创 Effective Objective-C 2.0:Item 25: Always Prefix Category Names on Third-Party Classes

Item 25: Always Prefix Category Names on Third-Party ClassesCategories are commonly used to add functionality to an existing class for which you don’t own the source code. This is an extremely pow

2013-12-08 16:22:45 1395

原创 Effective Objective-CItem 24: Use Categories to Break Class Implementations into Manageable Segments

Item 24: Use Categories to Break Class Implementations into Manageable SegmentsA class can easily become bloated with many methods all interspersed throughout a huge implementation file. Sometim

2013-12-08 16:04:11 767

原创 Effective Objective-C 2.0: Delegate and Data Source Protocols

iOS开发经最常见的模式:Delegate Pattern,定义和例子都是属于深入浅出的类型;可以帮助像我这样的初学者更好理解代理模式,平常对这个概念都是糊里糊涂的。。。Delegate protocol and Data Source Protocol 结合另一篇:Delegatehttp://blog.csdn.net/chuanyituoku/article/details/16890645Item 23: Use Delegate and Data Source Protocols f

2013-12-08 00:23:23 2523

原创 Effective Objective-C 2.0: Item 22: Understand the NSCopying Protocol

Item 22: Understand the NSCopying ProtocolA common thing to want to do with an object is to copy it. In Objective-C, this is done through the use of the copy method. The way in which you can sup

2013-12-07 23:02:57 5615

原创 Effective Objective-C 2.0: Item 21: Understand the Objective-C Error Model

Item 21: Understand the Objective-C Error ModelMany modern languages, including Objective-C, have exceptions. If you have come from a Java background, you’ll most likely be accustomed to using exc

2013-12-07 19:05:32 875

原创 Effective Objective-C 2.0:Item 20: Prefix Private Method Names

Item 20: Prefix Private Method NamesIt’s extremely common for a class to do much more than it appears on the outside. When writing a class implementation, it is common to write methods that are us

2013-12-07 17:50:23 1098

原创 Effective Objective-C 2.0: Item 17: Implement the description Method

如何重载description 和 debugDescription 赞Item 17: Implement the description MethodWhile debugging, you will often find it useful to print out an object to inspect it. One way is to write loggin

2013-12-07 11:09:31 840

原创 Effective Objective-C 2.0: Item 16:Designated Initializer

Item 16: Have a Designated InitializerAll objects need to be initialized. When initializing an object, you sometimes don’t need to give it any information, but often you do. This is usually the ca

2013-12-07 10:27:13 1127

原创 Effective Objective-C 2.0:Item 15: Use Prefix Names to Avoid Namespace Clashes

可惜没有指出怎么改第三方library名字的具体操作Item 15: Use Prefix Names to Avoid Namespace ClashesUnlike other languages, Objective-C has no built-in namespace feature. For this reason, it is easy for names t

2013-12-06 11:59:16 813

原创 Effective Objective-C 2.0:Item 14 Class Object

Item 14: Understand What a Class Object IsObjective-C is extremely dynamic in nature. Item 11 explains how the implementation for a given method call is looked up at runtime, and Item 12 explain

2013-12-06 00:10:51 971

原创 Effective Objective-C 2.0: Method Swizzling to Debug Opaque Methods

运行时替换方法实现(通常是新增一个方法(category),然后swap); 这里推荐了一个,debug时候有点用Item 13: Consider Method Swizzling to Debug Opaque MethodsThe method to call when a message is sent to an object in Objective-C is

2013-12-05 23:53:24 1295

原创 Effective Objective-C 2.0: Item 12: Understand Message Forwarding

这点很有意思,理清楚了Message Forward的过程(特别那个例子有意思),但是感觉 具体例子太少了~~ 难道是我没有理解透?Item 12: Understand Message ForwardingItem 11 explains why it’s important to understand the way messages are sent to objec

2013-12-05 22:47:41 1265

原创 Effective Objective-C 2.0: Associated Objects

例子有点少, 内存管理方面不清楚~~, Item 10: Use Associated Objects to Attach Custom Data to Existing ClassesSometimes, you want to associate information with an object. Normally, you would do this by sub

2013-12-03 14:51:05 960

原创 Effective Objective-C 2.0: Object Equality

这篇挺有用的,指出了很多注意点;以后用到Object Equality可以参考Item 8: Understand Object EqualityBeing able to compare objects for equality is extremely useful. However, comparing using the == operator is usually

2013-12-03 11:57:45 998

原创 养生:程序员需要强健的体魄!!!

最近感觉肝部有点痛,饭后,便后; 然后想到了 养肝 百度下会有很多说明~~http://www.cnys.com/bjam/18355.html总结下:禁忌:麻辣火锅(中了~~)海鲜发物(也中...)油炸油煎(天天中...)动物内脏(不易消化,但是看到以肝养肝,这个内脏没事吗?~~)干硬食物(不易消化,容易造成食道损伤;有道理,有时候饭后感觉食道疼...)

2013-12-03 10:51:43 815

转载 C++字符集的相互传换 and sqlite3_open 返回14

sqlite3_open 返回14,文件路径包含中文。解决方法:插入前,把SQL语句转UTF8格式。C++字符集的相互传换   #include #include #include using namespace std; //utf8 转 Unicodestd::wstring U

2013-12-03 10:08:58 2432

原创 Effective Objective-C 2.0:Item 7: Access Instance Variables

initializer: set 时候直接访问ivar;get时候看具体;一般情况下,set用accessors; get用ivar快 Item 7: Access Instance Variables Primarily Directly When Accessing Them InternallyProperties should always be used to

2013-12-03 00:14:30 1474

原创 Effective Objective-C 2.0: Item 6: Understand Properties

前面的runtime没看懂- -; 后面的atomicity 和 thread-safe 说明, 很好很强大 ^ ^Item 6: Understand PropertiesProperties are an Objective-C feature providing encapsulation of the data an object contains. Objects i

2013-12-02 23:55:12 1076

原创 SVN : Working copy is too old (format 10, created by Subversion 1.6)

svn报错Solve ""svn : Working copy is too old (format 10, created by Subversion 1.6)。这个其实是由于我替换的文件夹,里面包含隐藏文件.svn了,因此管理的路径也是不对的。解决办法,删除对应文件夹下的隐藏文件.svn,可能有多个需要删除。挨个删除后就能显示svn管理的符号了。刚开始会是这样的,,文件夹不会显示左下角

2013-12-02 15:05:44 7431

原创 Effective Objective-C 2.0: Item 4: Prefer Typed Constants to Preprocessor #define

Item 4: Prefer Typed Constants to Preprocessor #define曾经面试被被问到 Preprocessor #define 有什么缺点, 这篇文章很好解答了这个问题。 ^ ^When writing code, you will often want to define a constant. For example, consider

2013-12-02 11:35:15 957

原创 Effective Objective-C 2.0: Item 3: Prefer Literal Syntax over the Equivalent Methods

Item 3: Prefer Literal Syntax over the Equivalent Methods1. The literal syntax also works for expressions:Click here to view code imageint x = 5;float y = 6.32f;NSNumber

2013-12-02 11:03:52 1035

原创 Effective Objective-C: Minimize Importing Headers in Headers

Effective Objective-C 2.0的第二点:Minimize Importing Headers in Headers

2013-12-02 00:02:03 1384

原创 Objective-C’s Roots: Difference Between messaging structure and function calling; and the Runtime

Item 1: Objective-C’s RootsObjective-C is similar to other object-oriented languages, such as C++ and Java, but also differs in many ways. If you have experience in another object-oriented languag

2013-12-01 23:29:21 1144

原创 LLVM Overview

LLVM OverviewLLVM (originally an acronym for Low Level Virtual Machine) was conceived as a compiler framework for programs written in arbitrary languages. Currently, the LLVM project consists of

2013-12-01 11:54:44 694

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除