So, my goal is to have a variable whose value is unique to each instance of an Objective-C object. I want this variable to be declared in the .m file. I'm not allowed to have an instance variable in my Obj-C category's .m file. Can't even set a value for a key that doesn't already exist. My solution is to create a C++ class that I can use to store an instance variable. Since the objective is to make the data in the variable private, I've turned the category's .m file into a .mm file and created the class in there.
Now, I have to wonder: How do I make a C++ variable whose value I can pull from within my category's Objective-C methods? On top of that, how would I pull that value?
Thanks, guys!
Now, I have to wonder: How do I make a C++ variable whose value I can pull from within my category's Objective-C methods? On top of that, how would I pull that value?
Thanks, guys!