I am define TOOLS_COMPUTE_TIME like this
#define TOOLS_COMPUTE_TIME(op) [Tools computeTimeWithName:__PRETTY_FUNCTION__ block:(op)]
+(void)computeTimeWithName:(NSString *) caller block:(void (^)())block
{
NSDate * currentTime = [NSDate date];
block();
DLog(@"Time Running is: %f", [[NSDate date] timeIntervalSinceDate:currentTime]);
DLog(@"Caller : %@", caller);
}
and then when I call:
TOOLS_COMPUTE_TIME(^{
});
[Tools computeTimeWithName:ThisFunction block:^{
//I want to move this blog on top
NSString * urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%f,%f&output=csv",[BNUtilitiesQuick UtilitiesQuick].currentAnchor.coordinate.latitude,[BNUtilitiesQuick UtilitiesQuick].currentAnchor.coordinate.longitude];
NSURL * Url= [NSURL URLWithString:urlString];
NSString * result = [NSString stringWithContentsOfURL:Url encoding:NSASCIIStringEncoding error:nil];
NSArray *lines = [result componentsSeparatedByString:@","];
locationString =[NSString stringWithFormat:@"%@\"",[lines objectAtIndex:2]];
}];
it's still have many error.. like "Macro "TOOLS_COMPUTE_TIME" passed 4 arguments, but takes just 1"
something like that code have many argument, but I think that code pass just one argument like block
anyone can help me to fix it?
Another error seems to be on the type of PRETTY_FUNCTION It's not NSString * isn't it. What?