- 博客(367)
- 收藏
- 关注
转载 TinyXml快速入门
地址:1http://blog.csdn.net/clever101/article/details/5334369系列地址: 对于xml文件,目前我的工作只是集中在配置文件和作为简单的信息文件来用,因此我不太喜欢使用msxml这种重量级的xml解析器,特别是使用msxml解析xml涉及到复杂的com类型转换,更是令人感觉繁琐。因此对于简单的xml文
2014-01-17 11:16:13 539
原创 MySQL 和 Oracle 在插入时间类型值的区别
insert into table_name (time) values ( XX );Oracle:XX = to_date(\'%s\', \'YYYY-MM-DD HH24:MI:SS\')MySQL:XX = date_format(\'%s\', get_format(datetime, \'ISO\'))其中%s用表示时间的字符串代替
2014-01-17 10:01:45 655
原创 MutiBytes To UTF8
char * MbcsToUTF8(const char *file){ WCHAR *pwchar = 0; CHAR *pchar = 0; int len = 0; int codePage = AreFileApisANSI() ? CP_ACP : CP_OEMCP; len = MultibytesToWideChar(codePa
2014-01-16 17:22:35 1105
原创 NSThread
NSThread *thread = [ [NSThread alloc] initwithTarget: self selector:@selector(XX_Method_Name) object: args];[thread start];[thread release];。。。。定义 XX_Method_Name
2014-01-16 14:18:37 572
原创 Polymorphism, Dynamic Typing, and Dynamic Binding
Polymorphism enables programs to be developed so that objects from different classes can define methods that share the same nameDynamic typingdefers the determination of the class that an ob
2014-01-16 12:40:29 926
转载 The run destination My Mac 64-bit is not valid for Running the scheme
The run destination My Mac 64-bit is not valid for Running the scheme更新Mac系统到Mavericks后打开工程文件后,左边Project Navigator里面一片红色(frameworks); 运行出现上面的弹框提示错误:解决方案:(翔動聖絃提供)How to change the SDK: 1)
2014-01-09 14:49:58 687
转载 An Example SQLite based iPhone Application
Link:http://www.techotopia.com/index.php/An_Example_SQLite_based_iPhone_Application1. Creating the Database and Table- (void)viewDidLoad { NSString *docsDir; NSArray *dirPath
2014-01-05 23:37:09 727
原创 GCD实例1
2014/1/3 dispatch_group_t group =dispatch_group_create(); dispatch_queue_t queue =dispatch_queue_create("com.ycz.hc",DISPATCH_QUEUE_PRIORITY_DEFAULT); dispatch_group_async(g
2014-01-03 14:39:51 723
原创 由Clang LLVM 1.0 Error error: -fobjc-arc is not supported with fragile abi说起
好像是过了好久好久,我终于又拾起了老本行: Xcode在我的老项目中加了两个文件,报错:Clang LLVM 1.0 Error error: -fobjc-arc is not supported with fragile abi百度之,无;Google之,得到Stack Overflow解答:http://stackoverflow.com/questions/
2014-01-02 15:30:22 1472
原创 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 867
原创 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
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人