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
Post a Comment