How do I use set_associated_object when the property I want to add is an unsigned int (enum)?


Now I'm doing it like this, is it correct? Any risks? Thanks in
advance.



-(void)setNetworkStatus:(unsigned int)object{
objc_setAssociatedObject(self, @selector(networkStatus),
@(object), OBJC_ASSOCIATION_ASSIGN);
}

-(unsigned int)networkStatus{
return (unsigned int)[objc_getAssociatedObject(self,
@selector(networkStatus)) integerValue];
}


I have changed OBJC_ASSOCIATION_ASSIGN to
OBJC_ASSOCIATION_RETAIN_NONATOMIC in my code. Is there any
problem?


- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow