1.xcode debug
了解了每个设置的意思,个人觉得对于一个普通的app来说可以这样配置这些设置:
Generate Debug Symbols
:DEBUG和RELEASE下均设为YES
(和Xcode默认一致);Debug Information Level
:DEBUG和RELEASE下均设为Compiler default
(和Xcode默认一致);Deployment Postprocessing
:DEBUG下设为NO,RELEASE下设为YES,这样RELEASE模式下就可以去除符号缩减app的大小(但是似乎设置为YES后,会牵涉一些和bitcode有关的设置,对于bitcode暂时还不太了解(´・_・`));Strip Linked Product
:DEBUG下设为NO,RELEASE下设为YES,用于RELEASE模式下缩减app的大小;Strip Style
:DEBUG和RELEASE下均设为All Symbols
(和Xcode默认一致);Strip Debug Symbols During Copy
:DEBUG下设为NO
,RELEASE下设为YES
;Debug Information Format
:DEBUG下设为DWARF
,RELEASE下设为DWARF with dSYM File
,dSYM文件需要用于符号化crash log(和Xcode默认一致);
https://www.jianshu.com/p/11710e7ab661
2.限制uitextfiled输入
[self.name addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventEditingChanged]; - (void)textChange:(UITextField *)textField { NSString *str = [self filterString3:textField.text]; textField.text = str; } - (NSString *)filterString3:(NSString *)str { //只能输入英文和数字 NSString *regex = @"[^a-zA-Z0-9]"; return [str stringByReplacingOccurrencesOfString:regex withString:@"" options:NSRegularExpressionSearch range:NSMakeRange(0, str.length)]; }