之间的NSString这是我一直有关于传递类
混乱我永远不能似乎找到一个很好的解释,我理解继承,但是从我了解到,是大师班和他们的sublasses之间......如果我想一个的NSString传递到另一个阶级什么那不是的其他
一个子类继承人例如:
class1.h
@interface class1 : UIViewController{
NSString *string
}
@property (nonatomic, retain) NSString *string
@end
class1.m
@implementation class1
@synthesize string;
-(void)viewDidLoad{
string = @"IM A STRING AHHH";
}
现在可以说,我想传递什么它等于另一个类
class2.h
#import "class1.h"
@interface class2 : UIViewController{
}
@end
class2.m
@implementation class2
//i want to use the NSString in here, how do i do that?
感谢, 雅各
完美!谢谢伙计! – Jacob