0
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];

没有错误。

有人能帮我吗?

4

1 回答 1

0

shouldn't it be [stockObject.stockPric floatValue] ?

于 2013-03-28T10:03:05.037 回答