ios - How to convert a Number to NSString in Objective-C -


i have price parameter api price: 10 want show in textfield appending "$" after it. doesn't show number anyway casting it. here code :

cell.price.text = [[nsstring stringwithformat:@"%i", (nsnumber*)dic[@"items"][indexpath.row][@"price"]]  stringbyappendingstring:@" $"]; 

to print nsnumber need use %@ instead of %i

cell.price.text = [nsstring stringwithformat:@"%@ $", (nsnumber*)dic[@"items"][indexpath.row][@"price"]]; 

Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -