I'm working on a project that just needs to be rewritten but that is not an option at this point.
I have a C++ function that is called and does all kinds of stuff. I need it to read a variable from the App Delegate class.
For example I have:
@interface MyAppDelegate : NSObject <UIApplicationDelegate>
{
UIWindow *window;
MyViewController *viewController;
int mToleranceLevel;
}
I then have a function that needs to access the mToleranceLevel:
bool FindExtrinsics(...)
{
float maxError = mainDelegate.mMaxError;
...
}
The problem is that this was declared like so:
@interface MyClass : UIViewController
{
...
}
@properties ...
bool FindExtrinsics(...);
@end
So how would I get a value from the AppDelegate class. I do know how to get the current delegate:
mainDelegate = (RedStripeARAppDelegate *)[[UIApplication sharedApplication] delegate];
But how do I use this info to get the value in my C++ function. Is there a way to make a static variable so I can call MyAppDelegate.mToleranceValue;??