自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Reverse Engineering Mac OS X

Reverse Engineering Mac OS Xhttp://reverse.put.as/tools/

2013-12-30 16:58:58 659

翻译 Using Dynamic Libraries(Updating)

Linkage:https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/UsingDynamicLibraries.html#//apple_ref/doc/uid/TP40002182-SW10When you n

2013-12-26 17:23:42 629

原创 (OS X) Loading Code at Runtime

To load dynamic libraries at runtime, apps should use a set of efficient and portable functions, calleddynamic loader compatibility functions. Using these functions ensures that dynamic libraries ar

2013-12-26 11:38:01 836

原创 APIs to control the tasks in the dispatch queues.

Controlling Dispatch QueuesGCD also provides many useful APIs to control the tasks in the dispatch queues. Let’s see the APIs one by one to explore how GCD is so powerful.dispatch_set_target_que

2013-12-21 22:38:17 1793

原创 GCD: Obtaining Dispatch Queues

Obtaining Dispatch QueuesThere are two ways to do that, with dispatch_queue_create and main dispatch queue / global dispatch queue. The following sections discuss both of these.dispatch_queu

2013-12-21 12:54:08 1228

原创 Blocks: Conclusion

The following rules apply to variables used within a block:Global variables are accessible, including static variables that exist within the enclosing lexical scope.Parameters passed to the

2013-12-20 16:27:01 708

原创 Circular Reference with Blocks

Circular Reference with BlocksIf a Block uses an automatic variable of object type with a __strong qualifier, when the Block is copied from the stack to the heap, the Block has the ownership of th

2013-12-19 13:55:50 1269

原创 Blocks: __block Variables and Objects

__block Variables and ObjectsThe __block specifier can be used for any type of automatic variable. Let’s see how it is used for an id-type automatic variable to assign an Objective-C object.__

2013-12-19 11:29:49 1049

原创 Blocks Capturing Objects

Capturing ObjectsWe saw examples using integer variables. Next, let’s see what will happen when an object is used from a Block. In the next source code, an object of the NSMutableArray class is

2013-12-19 00:04:10 698

原创 Memory Segments for __block Variables

Memory Segments for __block VariablesIn the previous section, we’ve learned only about Blocks. How about __block variables? When a Block uses a __block variable and is copied from the stack to the

2013-12-18 23:02:14 661

原创 Memory Segments for Blocks

Memory Segments for BlocksIn the previous sections, we’ve learned that a Block is implemented as an automatic variable of a struct, and the struct is generated for the Block. Also __block variab

2013-12-18 21:46:20 868

原创 Blocks:Writable Variables

Writable VariablesNext we show how variables could be writable in Blocks. We see the two solutions to make variables writable, and start with reviewing the automatic variables that are used in Blo

2013-12-18 20:20:08 719

原创 Blocks:Capturing automatic variables

Capturing automatic variablesYou’ve learned about Block literals and Block-type variables, and should now understand the “anonymous function” part of “anonymous functions together with auto (local

2013-12-18 18:42:21 1132

原创 Block type variables

函数返回block时候值得注意Block type variablesAs we’ve learned, a Block literal looks the same as a function definition except it has no name and it has the “^” symbol. For the C function, the addres

2013-12-18 10:35:08 572

原创 Block Literal Syntax

Block Literal SyntaxThis section shows how to write Block literal. The syntax of Block literal is explained with examples. After reading this, you should be able to write Block literals.First,

2013-12-18 10:21:29 656

原创 Implementing __autoreleasing ownership qualifier

__autoreleasing ownership qualifierAssigning an object to any variables qualified with __autoreleasing is equivalent to calling the autorelease method in a non-ARC environment. Let’s see how it

2013-12-17 22:32:34 782

原创 Implementing __weak ownership qualifier

__weak ownership qualifierNext, we learn about the __weak ownership qualifier. We show what happens when an object is disposed of or when a newly created object is assigned and how an object is ad

2013-12-17 22:25:57 1021

原创 Implementing __strong ownership qualifier

__strong ownership qualifierLet’s see how the variables that are qualified with __strong work, using NSMutableArray class method “array” as an example. We see under the hood of calling the method

2013-12-17 22:24:33 598

原创 Array under ARC

ArrayI explained the ownership specifiers with ‘id’ or object type variables. In this section, I explain how we can use the specifiers with arrays.The following source code shows how to use a

2013-12-17 21:03:53 604

原创 ARC Rules

ARC RulesTo write and compile source code for ARC, you have to take care of a few things. Just by following the rules in the list below, you can write source code for an ARC-enabled environment wi

2013-12-17 20:07:42 1195

原创 Ownership qualifiers of Objective-C: In Details

详细介绍Objective-C的Ownership Qualifier,帮助更好理解ARC是怎么回事,实现细节;绝对算是专业级的讲解,找工作前理清思路、提高自信的必需品。With ARC, ‘id’ and object type variables must have one of the following four ownership qualifiers:__strong__weak__unsafe_unretained__autoreleasing

2013-12-17 10:44:30 1931

原创 Implementing Autorelease

AutoreleaseBecause of its name, you might think that autorelease is something like ARC. But it is not. It is more like “automatic variable” in the C language.7Let’s start by reviewing what aut

2013-12-16 16:53:19 1063

原创 Implementing alloc, retain, release, and dealloc

Implementing alloc, retain, release, and deallocMany parts of OS X and iOS are publicly available as open source software at Apple Open Source.1 As mentioned above, the alloc, retain, release,

2013-12-16 11:43:35 1259

原创 Ownership of Memory Management

You Have Ownership of Any Objects You CreateYou use a method whose name begins with one of the following, which means that you are creating an object and have ownership of it.allocnewcop

2013-12-15 22:28:09 655

原创 Effective Objective-C 2.0:Item 52: Remember that NSTimer Retains Its Target

Item 52: Remember that NSTimer Retains Its TargetTimers are a useful object to have at your disposal. The Foundation framework contains a class called NSTimer that can be scheduled to run either

2013-12-15 20:28:48 4083

原创 Effective Objective-C 2.0:Item 50: Use NSCache Instead of NSDictionary for Caches

Item 50: Use NSCache Instead of NSDictionary for CachesA common problem encountered when developing a Mac OS X or an iOS application that downloads images from the Internet is deciding what to do

2013-12-15 18:38:20 9518

原创 Effective Objective-C 2.0:Item 48: Prefer Block Enumeration to for Loops

Item 48: Prefer Block Enumeration to for LoopsEnumerating a collection is a very common task in programming, and modern Objective-C has many ways to do so, ranging from standard C loops to NSEnume

2013-12-14 23:29:41 1446

原创 Effective Objective-C 2.0: Item 47: Familiarize Yourself with the System Frameworks

Item 47: Familiarize Yourself with the System FrameworksWhen writing an application in Objective-C, you will almost certainly use the system frameworks, which provide many of the common classes, s

2013-12-14 22:59:22 916

原创 Effective Objective-C 2.0: Item 45: Use dispatch_once for Thread-Safe Single-Time Code Execution

Item 45: Use dispatch_once for Thread-Safe Single-Time Code ExecutionThe Singleton design pattern—no stranger in the Objective-C world—is usually achieved through a class method called something l

2013-12-14 14:29:26 1365

原创 Effective Objective-C 2.0: Item 44: Use Dispatch Groups to Take Advantage of Platform Scaling

Item 44: Use Dispatch Groups to Take Advantage of Platform ScalingDispatch groups are a GCD feature that allows you to easily group tasks. You can then wait on that set of tasks to finish or be no

2013-12-14 13:40:24 3296

原创 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 1292

原创 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 2008

原创 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 5223

原创 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 1120

原创 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 1254

原创 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 948

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

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

2013-12-11 21:55:51 1799

原创 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 1504

原创 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 1511

原创 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 878

空空如也

空空如也

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

TA关注的人

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