If you want to say only once during the entire duration of the application, you can use dispatch_once, for example:
-(void)methodName
{
action1;
action2;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self methodName];
});
}
, , , action1 action2 , :
1) :
- (void)executeMethod {
[self methodName];
[self methodName];
}
2) , :
- (void)methodName {
for(int i = 0; i < 2; ++i) {
action1();
action2();
}
}