您好,欢迎来到二三娱乐。
搜索
您的当前位置:首页有意思的bug

有意思的bug

来源:二三娱乐

服务器数据比较多,返回数据时,难免有些字段会出错。
如果是一个string字段,如果服务器写错,返回long类型。
客户端处理时就需要小心了。下面是我的一个错误吧。

@property (nonatomic, copy) NSString *shortName;
shortName.length;//此处造成崩溃。
为了安全起见,[NSString stringWithFormat:@"%@",shortName].length;

如下错误代码

    @autoreleasepool {
        for (UIView *view in [self subviews])
        {
            if (view.tag==100)
            {
                return;
            }
        }
    }

info.plist文件中的Supported interface orientations数组的顺序竟然会影响launchScreen显示方式(横屏还是竖屏)。launchScreen默认取第一个item的值显示,实践出真知啊。

Supported interface orientations
Documentation for isBeingPresented - This method returns YES only when called from inside the viewWillAppear: and viewDidAppear: methods. 

Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务