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?


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

HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .