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 |
Explain when to use nsarray and nsmutablearray. Which one is faster and threadsafe?
Is objective c and c the same?
What is .m file in objective c?
Is a fact objective?
What is gcd objective c?
Does objective c have multiple inheritance? Why not? How to imitate various inheritance?
What happens with the objects if the array is released?
What is difference between null and nil?
Mention what is the primary use of the category in the objective-c?
Can we create dynamic classes in objective c? If yes, explain how to create with a valid use case?
Can we implement dealloc in arc? If yes, what is the need to do that?
What is ivar objective c?