如何生成一个key

最懒的做法:

声明:static const char searchBlockKey;

set:objc_setAssociatedObject(self, &searchBlockKey, block,OBJC_ASSOCIATION_RETAIN_NONATOMIC);

get:searchBlockblock = objc_getAssociatedObject(self, &searchBlockKey);

你可能感兴趣的:(如何生成一个key)