What are blocks and how are they used?
What are blocks and how are they used?
Blocks in Objective-C are a language feature that allow you to create self-contained units of functionality that can be passed as arguments to methods or functions, or stored in variables. They are similar to closures in other programming languages.
Callbacks: Blocks are commonly used as callbacks, where a block is passed as an argument to a method or function and is executed when a certain event occurs.
Sorting and filtering: Blocks are used with methods like sortUsingBlock:
and filteredArrayUsingPredicate:
to provide custom sorting and filtering logic.
Asynchronous operations: Blocks are used with asynchronous operations...
junior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào