Consider:
NSString*test2=[[NSString alloc]init];
test2=@"yo";
NSString *test= test2;
NSLog(@"test: %@ test2: %@",test, test2);
test2=@"what the?";
NSLog(@"test: %@ test2: %@",test, test2);
Output:
2012-11-14 09:50:26.720 testt[693:c07] test: yo test2: yo
2012-11-14 09:50:26.721 testt[693:c07] test: yo test2: what the?
How does one make test a true pointer, such that when test2 changes, so does test?
NSString *test2is already a pointer. You’d want to maketestpointer to a pointer (double*), and assigntest2‘s address to it using&prefix then access the value using*prefix. I suck at explaining this so here is the code: