I would like to detect taps with a tapRecognizer in one class that triggers another class to create an object of a third class.
How Can I trigger this method from the tap detecting class without creating a new object of the second class?
Or would creating a new object of this second class be fine? It would lose all of its old data though.
How is triggering like this done? I tried something but it just warned about an object is being accessed in a class method.
e.g.
ViewController Class 1
+(void) setupClass2
{
Class2 class = .........
class.someValue = ......
self.navigationController pushViewController:class ......
}
// The calling/trigger class should be able to invoke the setupClass function e.g.
[Class1 setupClass];
How is this done correctly?
You have to declare a protocol with methods like this:
Then you assign a delegate that conforms to that protocol (class 2 in your case). Create the class 3 object in that callback.