开发者社区> 问答> 正文

objective-c的一个警告,请问怎么消除

define kVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

比较:

NSString* lastVersion = [[self updateService] lastAppVersion];

if([kVersion compare:lastVersion] != NSOrderedDescending){ 

    return YES ; 

} 

return NO ; 

现在比较的这一行总是有警告:Incompatible pointer types sending "NSString " to parameter of type "NSNumber "

展开
收起
杨冬芳 2016-06-29 18:40:23 2220 0
2 条回答
写回答
取消 提交回答
  • NSString* lastVersion = [NSString stringWithFormat:@"%@", [[self updateService] lastAppVersion]];

    2020-03-30 10:34:59
    赞同 展开评论 打赏
  • IT从业

    NSString stringWithFormat

    2019-07-17 19:49:19
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载