Invalid operands to binary expression ('double' and 'double’)

Invalid operands to binary expression (‘double’ and ‘double’)

在下面的代码中,实现功能是获取estimatedProgress是5的倍数的值做些操作,

  double estimatedProgress = 100;

     if(estimatedProgress%5==0) {——错误出现行

         NSLog(@"");

    }

解决—类型转换,将estimatedProgress转换为int

     if((int)estimatedProgress%5==0) {

         NSLog(@"");

    }

你可能感兴趣的:(iOS开发中问题)