Converting int into NSString

int, iphone, nsstring

Solution

If you want to change the int to string

NSString *strFromInt = [NSString stringWithFormat:@"%d",yourintvalue];

Problem

I want to convert a random int number in the `NSString` and then assign the NSString to another `NSString` but it crashes the app I am doing the following ``` int mynumber =(arc4random() % 1000 ); unique = [NSString stringWithFormat:@"%d",mynumber]; NSLog(unique) NSString*test=unique; ``` it gives crash when i write last line; It also prints values when I nslog the `unique` string.

Original source

Related problems