Unfortunately i'm not sure how to implement this so i'll draw out how I interpret it:
Class1.h
Code:
#ifndef _CLASS1_
#define _CLASS1_
#include "RandomAudioFramework.h"
class Class1 {
public:
RandomAudioFramework *mRandomAudioFramework;
DoSomethingWithFramework();
RandomAudioFramework ReturnClass1LocalFramework();
}
#endif
Class1.cpp
Code:
#include "Class1.h"
void DoSomethingWithFramework() {
mRandomAudioFramework->PlayBeep();
}
RandomAudioFramework RetrunClass1LocalFramework() {
return *mRandomAudioFramework;
}
Class2.h
Code:
#ifndef _CLASS2_
#define _CLASS2_
#include "Class1.h"
class Class2 {
EditClass1Variable();
}
#endif
Class2.cpp
Code:
#include "Class2.h"
void EditClass1Variable() {
ReturnClass1AudioFramework().Volume = 0;
}
main.cpp
Code:
#include <stdio.h>
#include "Class1.h"
#include "Class2.h"
void main() {
Class1 *class1 = new Class1;
Class2 *class2 = new Class2;
class2->EditClass1Variable();
return 1;
}
Now i've been programming objective-c for the past few days so remembering how to call things in Cpp is for somereason harder than usual but I think the gyst is there. I want to create Class1 and Class2 and have Class2 access Class1... I hope this makes sence