int *SliderMaximum = V1.TeamAmountAfterSave;
[sliderTeamSelect setmaximum:SliderMaximum];
我需要转换SliderMaximum
为浮点数我该怎么做?
int *SliderMaximum = V1.TeamAmountAfterSave;
[sliderTeamSelect setmaximum:SliderMaximum];
我需要转换SliderMaximum
为浮点数我该怎么做?
NSNumber *yourNumber = [NSNumber numberWithInt: SliderMaximum];
float yourFloat = [yourNumber floatValue];
而且您不需要指向 int的指针,它没用,计算分配一个指针并写入指向 int 的内部地址指针与分配一个int并在其中写入int相同。
您是否尝试过将其乘以浮点数?
CGFloat sliderMaximum = SliderMaximum * 1.0f;
[sliderTeamSelect setmaximum:[[V1.TeamAmountAfterSave] floatValue]];