本周看过文章汇总

这里列出本周看过的我觉得有意思的文章和摘要:

1)解密中国互联网

2)Friday Q&A 2013-10-25: NSObject: the Class and the Protocol

3) Should I Use a Property or an Instance Variable?
use Instance Variable is faster.

4)Fast Image Cache by Path.Inc

5) How We Built Messaging

6)Toll Free Bridging in Friday Q&A 2011-09-30: Automatic Reference Counting

__bridge simply transfers a pointer between ARC and non-ARC with no transfer of ownership.

CFStringRef valueCF = CFPreferencesCopyAppValue(CFSTR("someKey"), CFSTR("com.company.someapp"));  
NSString *value = (__bridge NSString *)valueCF; 
CFRelease(valueCF);

__bridge_transfer moves a non-Objective-C pointer to Objective-C and also transfers ownership, such that ARC will release the value for you.

NSString *value = (__bridge_transfer NSString *)CFPreferencesCopyAppValue(CFSTR("someKey"), CFSTR("com.company.someapp")); 

[self useValue: value];

__bridge_retained moves an Objective-C pointer to a non-Objective-C pointer and also transfers ownership, such that you, the programmer, are responsible for later calling CFRelease or otherwise releasing ownership of the object.

CFStringRef value = (__bridge_retained CFStringRef)[self someString]; UseCFStringValue(value);

CFRelease(value);


7) iOS 6 Push the limits

to avoid retain cycle, prior to ARC, use block, after ARC, should use weak or unsafe_unretained, because block is retained (in ARC) not copied (in non-ARC)


8) Customizing Navigation Bar and Status Bar in iOS 7

9) doing the impossible things in LinkedIn

Ted /
Published under (CC) BY-NC-SA in categories summary  tagged with summary 

comments powered by Disqus