I'm trying to figure out how to declare a method that takes a block as an argument and just logs an integer value from the outside scope. Most examples I see are doing this on some Apple API like indexesOfObjectsPassingTest:
but I just want to create my own simple version. This is what I have, which is currently not working:
@interface IAViewController ()
+(void)tell2:(void(^)(void)) thisBlock;
@end
...
NSInteger someInt=289456;
[IAViewController tell2:^{
NSLog(@"what is this? %i", someInt);
}];
// ? how do I make this method signature work
+(void) tell2:(void (^thisBlock)) myInt{
thisBlock(myInt);
}
How can I make the method signature params work correctly to output 289456?