The preface

For us programmers, it’s an interview with a company. I am very sorry to be informed that I did not pass the interview. There are basically two reasons for failing the interview: one is not competent enough. Two interview skills are not well developed. Compared with the first one, it may be a pity, but we also recognize it, but the second one is that the most regrettable thing is that the interview questions or some very basic questions are not well played. Next, I will share with you some knowledge points that big factory interviewers need you to master every day.

What is a Block

Simply put, a Block is an object that encapsulates a function and its execution context.

Take a chestnut

To compile the.m file with the clang-rewrite-objc wytest. m command, the block is compiled to this form:

WYTest is the file name and blockTest is the method name, which can be ignored.

Where the __WYTest__blockTest_block_impl_0 structure is

The __block_impl structure is

A block has an ISA pointer inside it, so it is essentially an OC object

Inside the block is:

So a Block is an object that encapsulates a function and its execution context

Since a block encapsulates a function, it also has parameters and return values.

conclusion

For iOS heavy enthusiasts, usually prefer to collect some interview information and iOS related source video. The above are some of their own experience to share, welcome everyone comments and corrections, but also hope to be helpful to Meng Xin. Incidentally for a wave of attention, need to learn information and programming problems of the students, you can see my introduction of the exchange group to exchange, discuss it.