I have an interface called A that’s saves some values to float type:
I declare in .h file:
float x,y;
and in the .m files initilizing them:
x=56.4;
y=666.3;
How can i access those values from another interface? I want to do something like this:
float MyX = A.x;
float myY = A.y;
You should indeed use properties. Properties ‘exposes’ your variables and generates a pair of getter/setter methods automatically. In your .h file you can declare the following:
And you should synthesize then in your .m file:
Then you can access the variables the way you want it 😉