Lets say,
-(void) someFunction{
Foo* obj = [array objectAtIndex:1];
[self performSelector:@selector(anotherFunction:) withObject:obj afterDelay:2];
}
-(void) anotherFunction:(Foo*) foo{
//do something : like runActions
}
I understand that perform selector will schedule a timer on the same thread which will execute after the given delay. What I am not being able to determine with certainty is if obj can get released before the selector is called? I have tried with different delay values and code has not crashed so far but i would like to know for sure. The object is being passed by reference to the selector but i don't know if the pointer will have a strong hold on the object if somehow the array gets released meanwhile.