iOS 上如何查看日志信息
App开发中难免会遇到各种各样的问题,特别是有些信息不能在Debug 状态下重现,所以不得不记录日志信息到文件中,方便以后分析问题。
但是因为苹果系统的封闭型,日志信息除了上传服务器就只能保存在App的沙箱里面,查看很不方便。
###正则表达式中慎用空格
今天给同事写个正则表达式校验长度。
正则表达式为: .{6, 20}
同事测试后反馈说匹配不住。
打开http://regexpal.com/网站测试下,真的匹配不上。检查了逗号、花括号也都是半角的。语法也没用错,奇了怪了。
把空格删掉,结果匹配成功。
写代码时参数和逗号之间习惯写个空格。没想到出岔子了。以前还真没注意有这个细节。
QQ群里一网友,开发一iOS APP,提交审核时老提示下面错误。
Archive validation failed due to the issues listed below.
iTunes Store operation failed.
unable
to process application at this time due to the folloewing error: This
bundle is invalid. The IPA format requires a top-level directory named
Payload, contains only a .app bundle and optional plugins in plugins
directory.