I simply want to access a NSString from my first class in my second class.
I used properties in my first class and this:
NSLog(@"The text is: %@", self.fileText);
returns the correct string in my first class.
But in my second class, this:
FirstViewController* controller = [[FirstViewController alloc] init];
NSLog(@"text: %@", controller.fileText);
returns (null).
I imported the class correctly.
What could I have done wrong?
Use this
and to retrieve saved data in the second class, use this: