I have an a property declared in .h as
@property (nonatomic, assign) int timeSig_Numerator;
and an instance variable declared in the .h as
int mTimeSig_Numerator;
in the .m I synthesize with
@synthesize timeSig_Numerator = mTimeSig_Numerator;
I have a C function declared before the synthesize and need to use mTimeSig_Numerator. what is the best way to make the instance variable visible to my C function without passing it in as a function argument?
Since
mTimeSig_Numeratoris an instance variable, each instance of your class has its ownmTimeSig_Numerator. As a C function is decoupled from any given class/class instance, how would it know from which instance it should obtainmTimeSig_Numerator?Your C function needs either an argument containing the value of
mTimeSig_Numeratorin a specific instance, or an argument pointing to the instance itself, or some other mechanism that tells the function which specific instance/instance variable it should use.