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?