Hi,
I have two classes, Class A and Class B, both of them are subclasses of UIViewController.
I class A I have an NSString and I want to use this NSString in class B.
ClassA.h:
@class ClassB;
@interface ClassA : UIViewController {
ClassB *classB;
NSString stringA;
}
@property (nonatomic, retain) ClassB *classB;
@property (nonatomic, retain) NSString *stringA;
@end
ClassA.m:
stringA = [NSString stringWithString:webView.request.URL.absoluteString];
ClassB.h:
@class ClassA;
@interface ClassA : UIViewController {
ClassB *classA;
NSString stringB;
}
@property (nonatomic, retain) ClassB *classA;
@property (nonatomic, retain) NSString *stringB;
@end
ClassB.m:
- (void)viewWillAppear:(BOOL)animated {
self.stringB = classA.stringA;
}
Of course I did #import for both classes. For some reason I always get NULL I classB for stringB.
Thanks!