I am a bit familier with the concepts of Blocks but I don't know how to create them in iOS5. Can anyone provide me with a simple example ? Much appreciated :)
Use this simple example in Blocks..
int multiplier = 7;
int (^myBlock)(int) = ^(int num) {
return num * multiplier;
};
NSLog(@"Sum = %d",myBlock(20));
Then you will get as 140
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With