你知道我怎样才能将浮点值转换为nsstring值,因为我的代码存在错误.
我的代码:
- (float)percent:(float)a :(float)b{
return a / b * 100;
}
- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects {
// ....
float tx_nb_demande_portabilite = [self percent: [(NSNumber*) [stat nb_demande_portabilite] floatValue] :[(NSNumber*) [stat nb_users] floatValue]];
NSString *tx_nb_demande_portabilite_st = [NSString stringWithFormat:@"%@", tx_nb_demande_portabilite];
//....
}
Run Code Online (Sandbox Code Playgroud)
错误 :
EXC_BAD ACCESS for NSString *tx_nb_demande_portabilite_st = [NSString stringWithFormat:@"%@", tx_nb_demande_portabilite];
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助.
我的构建错误.Xcode返回
Undefined symbols for architecture i386:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
你知道如何使用-v启动构建来查看调用吗?
objective-c ×2