What are blocks and how are they used?
Answer / Vikrant Upadhyay
Blocks in Objective-C are anonymous functions that can be defined inline and passed around like any other object. They consist of a sequence of statements enclosed within curly braces `{}`. Blocks are commonly used for: 1. Event handling (e.g., tap gestures, button clicks). 2. Asynchronous processing with GCD (Grand Central Dispatch). 3. Customizing UI animations.
| Is This Answer Correct ? | 0 Yes | 0 No |
Is there function overloading in objective-c?
Who calls dealloc method? Can we implement dealloc in arc?
What is difference between method and constructor?
What are the adavantages of gcd over nsthread?
How to call function in objective-c?
What is an accessor method?
What is data encapsulation in objective-c?
What is an example of category?
What is objective c programming used for?
Will objective c be deprecated?
What are the advantages of swift over objective c?
Can I write some c++ function in same .m file?