I am trying to make an app that contains a class that is created in the app delegate.
I initialize it with:
Mobile *tmp = [[Mobile alloc] init];
mobile = tmp;
[tmp release];
and then I try to use it in other classes in my app with this:
projectAppDelegate *delegate = (projectAppDelegate *)[[UIApplication sharedApplication] delegate];
mobile = delegate.mobile;
but when I do something like:
[mobile enter:x :y];
it crashes…
Is there something I did wrong, or is there any solution for making a class that all the other classes in the app can use?
Thank you.
If you want to use instances of your object you have to store them as properties of app delegate.
Than you have to get a pointer to your application delegate shared instance and call your
mobileproperty.