Before anyone says its a similar or duplicate question of xxxx question, I have checked 27 questions till now and none of them is able to clear myquery and help me, most possibly coz no one posted the question in its most simplest form.
So I have a NS String in Class 1 in which I store some data.
##Class 1
.h
@property ..... NSString *str;
.m
-(void) someMethod {
self.str = @"Blah blah";
}
Now I want to access this "Blah Blah" data from the property "str" in Class 2 without passing it via any methods or such. I just need to access it somewhere (for example lets say viewDidLoad). What would be the most simplest way ?
PS:I was thinking to create a *tempString variable in appdelagate.m and access it in w/e class I want by creating a AppleDelegate *apdg object and accessing it. Any other ideas ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…