I have some Objective-C++ code that I'm trying to get events out of an Objective-C object to call a method within a C++ object. I'm very new to Objective-C, so I may be doing this all wrong.
Example:
@interface KnobClass {
}
-(void)Event;
@end
class DoorClass {
public:
KnobClass * knob;
void start() { knob = [[KnobClass allocate] init]; }
};
class AlarmClass {
public:
void Alert();
};
class HouseClass {
public:
DoorClass door;
AlarmClass alarm;
};
int main() {
//...
HouseClass house;
house.door.start();
//...
return 0;
}
The method [house.door.knob Event]
is generated on an event, and I want it to be able to call house.alarm.Alert()
. But I'm confused how to accomplish this in a correct manner. Can someone suggest a way of accomplishing this?