Magic-Unique / Weak-Category-by-Runtime

A tool to create weakly property in category.

Home Page:http://www.jianshu.com/p/ed65d71554d8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weak-Category-by-Runtime

A tool to create weakly property in category. explain

一个在分类中创建弱引用属性的工具,原文链接

USAGE 使用

// in a category...

#import "MUAssociation.h"

// @property (nonatomic, weak) id someProperty; // write in .h file

@implementation SomeClass (SomeCategory)
  
- (void)setSomeProperty:(id)someProperty {
	[self setAssociatedObject:someProperty forKey:@"someProperty" association:NSAssociationWeak isAtomic:NO];
}

- (id)someProperty {
	return [self associatedObjectForKey:@"someProperty"];
}

@end

About

A tool to create weakly property in category.

http://www.jianshu.com/p/ed65d71554d8


Languages

Language:Objective-C 100.0%