I need to create a class that gets a delegate does some calculation and then calls the delegate.
- Where am i suppose to release the object I allocated?
- Is it possible to init the MyClass object without allocating it, so that way I don't have to release it.
What is the best practice to do such a thing? (I am trying to create a web service class which reads data, and as soon as it's done it sends back the data to the delegate and it destroys itself)?
-(void)viewDidLoad { MyClass *class = [[MyClass alloc] initWithDelegate:self]; }
-(void) MyClassRespond :(NSData*)data { //use data and populate on screen }