Skip to content

Commit

Permalink
[M][0]: add multi thread notice
Browse files Browse the repository at this point in the history
  • Loading branch information
yinjiaji committed Aug 15, 2019
1 parent 8f176f6 commit 700db2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NSObject+Attachment.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

@interface NSObject (Attachment)

@property (atomic, strong) id attachment;
@property (nonatomic, strong) id attachment;

@end
1 change: 0 additions & 1 deletion NSObject+Attachment.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ @implementation NSObject (Attachment)

- (void)setAttachment:(id)attachment
{

objc_setAssociatedObject(self, (__bridge const void *)(kAttachmentKey), attachment, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ button.attachment = <your data>;
id <your data> = button.attachment;
//
}
```
```

## 注意

attachment 的settter 和 getter 不是线程安全的,多线程问题,需要在调用的处理。

0 comments on commit 700db2b

Please sign in to comment.