I have a function on a class “loadingViewController” that needs to be accessed from other classes. First time that I call function like follows, it works but if I then call it again from another class do not because allocates it again and reset parameters. Same if I create an instance method. How to simply call a function from another class without init or allocate again? Probably basic newbie issue… Thanks.
class was declared in header and properly synthesized.
self.loadingController = [[loadingViewController alloc] initWithNibName:@"loadingViewController" bundle:nil];
[loadingController incrementProgress:0.1];
Hard to say for sure without seeing more code, but I’m thinking you just need to make sure you only initialize the
loadingControlleronce: