[英]implicit conversion loses integer precision 'NSUInteger' (aka 'unsigned long') to 'int' when making app?
[英]implicit conversion loses integer precision 'NSUInteger' (aka 'unsigned long') to 'int' warning?
嗨,我收到此錯誤! 我在indexpath.row中使用NSNumber,但它給出警告,我的代碼有什么問題,請幫忙。
NSNumber *num=[NSNumber numberWithInt:indexPath.row];
[HUD showWhileExecuting:@selector(callingMethod:) onTarget:self withObject:num animated:YES];
indexPath.row
返回的NSInteger
值不是int
值。 嘗試這個
NSNumber *num=[NSNumber numberWithInteger:indexPath.row];
您可以使用框式表達式。 在這里你可以怎么做:
NSNumber *num = @(indexPath.row]);
[HUD showWhileExecuting:@selector(callingMethod:) onTarget:self withObject:num animated:YES];
這將以正確的格式轉換您的電話號碼;
讓我知道這是否對您有幫助:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.