Stock *stockObject;
stockObject = [[Stock alloc]initWithIssuingCompany:addCompany stockName:@"one" stockPrice:[NSNumber numberWithFloat:150.3]];
[availableStocks addObject:stockObject];
float myfloat = [s.stockPrice floatValue];
NSLog(@" singleton @%f",myfloat);
试试这段代码,但它会粉碎:
float myfloat = [s.stockPrice floatValue];
没有错误。
有人可以帮助我吗?
答案 0 :(得分:0)
不应该是[stockObject.stockPric floatValue]
?