You have to connect both these classes!!!!
You are creating two different objects and then trying to access value of one object's member in another object. Do this.
While you are coming to Chapter Class from Subject Class, you might be pushing or presenting the chapter class.
//in Subject Class, while creating Chapter class
Chapter* newClass = [Chapter alloc] init];
newClass.parentObject = self;
//code for transitioning to chapter controller
// in Chapter Class, create a parent object
@property (nonatomic, assign) Subject* parentObject;
OR if SUBJECT is a generalized common class,
then you could create a method to return a common instance of it. Something like this,
+ (Subject *) sharedInstance
{
@synchronized([Subject class]) {
if (!instance) {
instance = [[Subject alloc] init];
}
}
return instance;
}
And then access Subject Class members as,
Subject *sub = [Subject sharedInstance];
NSLog(@"%@"sub.htmlURL);