Skip to content

Instantly share code, notes, and snippets.

View tangyumeng's full-sized avatar

tangyumeng tangyumeng

View GitHub Profile
https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html
https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW20
// DLog will output like NSLog only when the DEBUG variable is set
#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define DLog(...)
#endif
// ALog will always output like NSLog
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
//
// NSObject+Association.h
//
// Created by Maciej Swic on 03/12/13.
// Released under the MIT license.
//
#import <Foundation/Foundation.h>
@interface NSObject (Association)
@tangyumeng
tangyumeng / 获取NSString 字节长度的Category.md
Created February 14, 2014 10:20
获取NSString 字节长度的category
@interface NSString (StringLength)
- (NSUInteger) byteLengthWithEncoding:(NSStringEncoding)encoding;
@end
 
@implementation NSString (StringLength)
- (NSUInteger) byteLengthWithEncoding:(NSStringEncoding)encoding {
    if (self == nil) {
        return 0;
    }
    const char* byte = [self cStringUsingEncoding:encoding];
@tangyumeng
tangyumeng / gist:9064932
Created February 18, 2014 05:03
method swizzling
@tangyumeng
tangyumeng / DerivedData
Created March 18, 2014 01:11
DerivedData
/Users/tangyumeng/Library/Developer/Xcode/DerivedData
@tangyumeng
tangyumeng / 锚点.md
Created March 18, 2014 02:23
锚点的用发