I want to make the following object accessable by all my code functions "public".
SomeObj *myobject = [[SomeObj alloc]init];
Please note that I have initialized the object inside interface by the following code , but i dose not work
Someobj *myobj;
But when I use alloc init , its work fine but I dont know how to access the myobj from another function , such as
- void runcar() {
Cars *mycar = [[Cars alloc]init];
[mycar run];
}
My question how I can stop the car from another function ??