Initialize NSArray with floats?

后端 未结 7 2109
你的背包
你的背包 2021-02-12 19:54

Is this a valid way to initalize an NSArray with float objects?

NSArray *fatArray = [NSArray arrayWithObjects:
                    [NSNumber numberWithFloat:6.9]         


        
7条回答
  •  情深已故
    2021-02-12 20:47

    I agree with mouviciel. Since you can't put simple types into an Array this is the way to do it. Looks a bit strange and is a lot of code to write but it is fine.

提交回复
热议问题