我在XCode中得到此错误,无论我放入什么格式说明符,或者如果我更改为NSInteger,NSUInteger,long或int,仍然会出错!?我怎样才能解决这个问题?
在
-(UIVIEw *)pickerVIEw:(UIPickerVIEw *)pickerVIEw vIEwForRow:(NSInteger)row forComponent:(NSInteger)component reusingVIEw:(UIVIEw *)vIEw
{
我有这些行,第2行是@“%lu”的错误,(行%max)
NSUInteger max = (NSInteger)[self.calendar maximumRangeOfUnit:NSCalendarUnitHour].length;[lblDate setText:[Nsstring stringWithFormat:@"%lu",(row % max)]]; lblDate.textAlignment = NSTextAlignmentRight;
感谢帮助 !
解决方法 对于NSInteger,您应该使用%td或%tu来表示NSUInteger有关详细信息,请参阅此链接https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html
@H_404_0@ 总结以上是内存溢出为你收集整理的ios – Format指定类型“unsigned long”但参数的类型为“int”全部内容,希望文章能够帮你解决ios – Format指定类型“unsigned long”但参数的类型为“int”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)