Question: I'm trying to create a method with an argument in objective-c, the argument is an amount of seconds before the actual method starts. 

I'm trying to avoid using the `[self performSelector:(SEL) withObject:(id) afterDelay:(NSTimeInterval)];` because having the delay within my method would actually save me a lot of coding as I am planning to add other arguments to this method.

Example of the method: 

```
-(void) startMethodAfterArgumentDelay: (NSTimeInterval *)delay{
     NSLog(@"perform action after argument delay");
}

```

and how to call it: 

```
[self startMethodAfterArgumentDelay:3.0f];

```

Any help would be greatly appreciated!

Answer: 
If you don't want to use any 3rd party libraries as the other answer suggested, this is easy enough to implement yourself using GCD's [dispatch\_after()](https://developer.apple.com/library/mac/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html#//apple_ref/c/func/dispatch_after). Just note that this method is a asynchronous, so your method will return immediately even though the contents of the block are delayed.

```
- (void)startMethodAfterArgumentDelay:(NSTimeInterval)delay
{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        NSLog(@"perform action after argument delay");
    });
}

```
You can use [BlocksKit](https://github.com/zwaldowski/BlocksKit) and then write code like that:

```
[self bk_performBlock:^(id obj) {
    //code
} afterDelay:delay];

```