Home ObjC runtime tips 01
Post
Cancel

ObjC runtime tips 01

Some hidden details in Language.

Runtime , Self and Super with Init

1
2
3
4
5
6
7
8
9
10
11
   @implementation Son : Father
   - (id)init
   {
       self = [super init];
       if (self) {
           NSLog(@"%@", NSStringFromClass([self class]));
           NSLog(@"%@", NSStringFromClass([super class]));
       }
       return self;
   }
   @end

output:

1
2
3
NSStringFromClass([self class]) = Son
NSStringFromClass([super class]) = Son

Memory Management

What and where are the stack and heap?

  • What are the stack and heap?
  • Where are they located physically in a computer’s memory?
  • To what extent are they controlled by the OS or language run-time?
  • What is their scope?
  • What determines their sizes?
  • What makes one faster?
This post is licensed under CC BY 4.0 by the author.

Binary Search Trees

Fullstack Development with React