ios - Using associative references in categories -



ios - Using associative references in categories -

although using associative references seems used method false category variables, can't help thinking of hack. i'm wrong. question. so, know apple uses categories many of framework classes, , did way before 3.1 (when associative references added). makes me wonder, doing in different way? associative references used way recommended apple? (any docs sustaining this?) design point of view, adding storage category avoid?

associated objects not hack, provided standard functions in "modern" runtime.

you right, associated objects not implemented before "modern" runtime, apple had no utilize them. if wished add together variables class, done combination of explicit setter/getter/internal ivar (you'll notice old cocoa classes nssplitview) in main class (because why need utilize associated objects if owned framework?) apple's utilize of categories old way of grouping similar functions together, language level #pragma mark -.

ios objective-c clang categories

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -