-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.m
More file actions
47 lines (34 loc) · 1.09 KB
/
ViewController.m
File metadata and controls
47 lines (34 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// ViewController.m
// HardShell
//
// Created by 郭朋 on 28/02/2017.
// Copyright © 2017 Peng. All rights reserved.
//
#import "ViewController.h"
#import "NSObject+HardShell.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
UILabel *label = [[UILabel alloc] init];
label.center = self.view.center;
label.text = @"HardShell";
[label sizeToFit];
[self.view addSubview:label];
// unregonized selector crash
UIButton *button = [[UIButton alloc] init];
[button performSelector:@selector(noThisMethod:)];
[button performSelector:@selector(description)];
// KVO
[label addObserver:self forKeyPath:@"text" options:NSKeyValueObservingOptionNew context:nil];
[label addObserver:self forKeyPath:@"text" options:NSKeyValueObservingOptionNew context:nil];
[label removeObserver:self forKeyPath:@"textColor"];
//label.text = @"new text";
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end