- (void)viewDidLoad {
[super viewDidLoad];
static NSString *haha = @"hehehehe";
NSLog(@"static");
// Do any additional setup after loading the view, typically from a nib.
}
如上述代码所示,很简单的iOS模版工程。局部变量、全局变量(无论是非静态)指向的常量字符串都会出现在__DATA段的CFString节里,但是用machoview或者hopper都看不到hehehe,能看到static。
环境是在DEBUG下,而且为了避免优化,还实验了__attribute__((used))来避免符号被去除。
请问有人知道吗?谢谢~