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];
没有错误。
有人能帮我吗?