Is it possible to access another instance's variables, given that we're working in the same class?
Or, in other words, can you do this Java code (which works in Java, I've done it before) in Objective C:
class Matrix {
private int mat[] = new int[16]; //wouldn't be a pointer in C
public Matrix (Matrix m){
for (int i = 0; i < 16; i++){
this.mat[i] = m.mat[i]; //<-- this here
}
}
}
Given that arrays cannot be properties in Objective C, I can't make mat[] into a property. Is there any way to do this then?