I want to translate this java code into equal objective-c code
double[] pMatrix = {50,100,150};
double[][] mMatrix = {{0.5,0.4,0.1}};
In java I have this as class properties. So I need to be able to access them everywhere in my class. I tried to put that code in the header file but it did not work.
Any ideas?
Objective-C++ supports C/C++. So, you must define
extern double Matrix[];in the header and youdouble Matrix[] = {50,100,150};in the .mm. Also, you can define the same values as static members of some class (C++) or return them via static public methods.