Objective-C แปลง int เป็น string

posted on 25 Feb 2009 23:58 by xnanoob  in Other

อบรมเรียน PHP AJAX 


TIP OF THE DAY

int myInt = 360;
NSString* myNewString = [NSString stringWithFormat:@"%d", myInt];

หรือถ้าเป็น float ก็เป็น

float myFloat = 123.45;
NSString* myNewString = [NSString stringWithFormat:@"%f", myFloat ];


จดไว้อะ บายค่ะ

 

Comment



smilebig smileopen-mounthed smileconfused smilesad smileangry smiletonguequestionembarrassedsurprised smilewinkdouble winkcry

Tweet