associated_obj.m

Objective-CMestre

Explorer

C40
C++40
C#40
Dart40
Go40
Java40
JavaScript40
Kotlin40
Objective-C
Iniciante10
Intermediário10
Avançado10
Especialista5
Mestre5
block_retain.m
runtime_swap.m
kvo_observe.m
gcd_barrier.m
associated_obj.m
Perl40
PHP40
Python40
R40
Ruby40
Rust40
Shell40
Swift40
TypeScript40
associated_obj.m
Click to focus
1
2
3
4
5
6
7
8
9
10
static char kAssociatedKey;
@implementation UIView (Custom)
- (void)setCustomData:(id)data {
   objc_setAssociatedObject(self, &kAssociatedKey, data,
                           OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (id)customData {
   return objc_getAssociatedObject(self, &kAssociatedKey);
}
@end
0WPM0%0:000/299(0%)|Ln 1, Col 1
UTF-8Objective-C

Exercícios Relacionados