首汽租车面试题

首汽租车面试题

首汽租车面试题

1.什么是野指针?什么情况下会野指针?

2.打印结果:

1
2
3
4
5
6
7
8
- (void)testWeak {

id obj1 = @"12131";
__weak id obj2 = obj1;
id obj3 = [NSObject new];
__weak id obj4 = [[NSObject alloc] init];
NSLog(@"obj1:%@ obj2:%@ obj3:%@ obj4:%@",obj1,obj2,obj3,obj4);
}

3.子类怎么重写父类的属性?问题简化怎么重写一个类的属性?只重写set方法可以吗?

4.了解哪些设计模式?单例有哪些不好的地方?

5.说一下响应者链

6.Masonry 链式调用的实现,实现一个控制器,属性的链式调用(手写)

7.打印结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- (void)testGCD {

dispatch_queue_t queue = dispatch_queue_create("testqueue", DISPATCH_QUEUE_SERIAL);

dispatch_async(queue, ^{
NSLog(@"1");
dispatch_async(queue, ^{
NSLog(@"2");
dispatch_sync(queue, ^{
NSLog(@"3");
});
NSLog(@"4");
});
NSLog(@"5");
});
}

8.项目亮点或难点

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×