AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
The above is the whole content of this article. The memory occupied by the instance in Objective-C The data structure of the class in Objective-CĢ. Ok, forget this section (customize a class and its corresponding structure) The articles in this series include:ġ. Cpp file, we only looked at a rough idea, not all of it. After all, when we viewed the data structure in the above. So it was effective in the class to structure conversion in the first experiment, perhaps by accident. If you have a new understanding, please give me advice! I don't know what has been done in + alloc for the time being, so I'm covered here. After all, the + alloc method must be used to create a normal object in OC. This operation is likely to be similar to + alloc Methods are related to operations. I guess: in the process of conversion, it is not only a simple assignment operation, but also other address access operations. Nobj_s has the correct value, which means that there is no problem with the nobj_sponter pointer, but why does it report a bad address access error? And the address value is the same 0x20 every time. Simple analysis (all my analyses here are guesses, and I don't know for the time being, ) Look at the above figure, there is a key point that can not be ignored, which is the value here: Since block has learned from many years of misunderstanding, it will be very sensitive to the crash encountered. Create a file and simply write the following code: // customfile. First, take a look at the structure of nsobject. Therefore, to study the class structure in OC, you can convert the OC code into C + + code. The code in OC is implemented at the bottom, using C and C + +.
0 Comments
Read More
Leave a Reply. |