错误日志

1. Local declaration of "xxx" hides instance variable 

原因: 本地变量跟函数参数变量同名了。


2.Variable is not assignable(missing __block type specifier

原因:对于外部普通变量,block只有读取的权限,要想对外部变量具有写权限,需要在变量前加 __block


3.Xcode模拟器 内置键盘不可以输入,(外接键盘和内置键盘不可以同时输入)

解决: command + shift +k 


4.

原因:设置imageView的image时,实例化image时不能传入nil  例如错误用法:imageView.image = [UIImage imageNamed:nil];


5. LaunchServices:ERROR :There is no registered handler for URL scheme xxx

原因:运行模拟器时,报的错误。我检查了下 info.plist 文件里配置是没有问题的,后来发现是设备上没有安装 客户端,此时会走网页端。


6.The 'viewDidAppear:' instance method in UIViewController subclass 'MyViewController' is missing a [super viewDidAppear:] call)

原因:Product - Analyze 时,出现上述问题,方法体中没有写  [superviewDidDisappear:animated];


7. <Error>: CGAffineTransformInvert: singular matrix.

设置了缩放比例为零

  self.forDisplayButton.transform = CGAffineTransformMakeScale(0, 0);

  改为:

self.forDisplayButton.transform = CGAffineTransformMakeScale(0.01f, 0.01f);


8.Collection <__NSDictionaryM: 0x174251fa0> was mutated while being enumerated

原因: 当程序出现这个提示的时候,是因为你同时遍历你的数组/字典,同时又修改你数组里的数据,导致崩溃。

方法1.    定义一个一模一样的数组,遍历数组A 然后操作数组B

  NSMutableDictionary * mutableDictionary = [[NSMutableDictionary alloc] initWithDictionary:parameters];
    for (NSString * key in mutableDictionary) {
        [parameters setObject:@"ddddddd" forKey:key];
    }
    NSLog(@"-----------------%@",parameters);

方法2.     用系统自带的遍历

    NSMutableArray *tempArray = [[NSMutableArray alloc]initWithObjects:@"12",@"23",@"34",@"45", nil];
    [tempArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        
        if ([obj isEqualToString:@"34"])
        {
            [tempArray replaceObjectAtIndex:idx withObject:@"3333333"];
        }
    }];
    
    NSLog(@"%@",tempArray);



MinJing_Lin的博客

点击打开链接



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值