Primitives can be converted to objects with @()
expression. So the shortest way is to transform int
to NSNumber
and pick up string representation with stringValue
method:
NSString *strValue = [@(myInt) stringValue];
or
NSString *strValue = @(myInt).stringValue;
More Related Contents:
- Synthesized property and variable with underscore prefix: what does this mean? [duplicate]
- Check that a input to UITextField is numeric only
- What’s the difference between “class method” and “static method”?
- Compiler error: “initializer element is not a compile-time constant”
- presentViewController: crash on iOS
- Objective-C Exceptions
- Why put underscore “_” before variable names in Objective C [duplicate]
- Caret character between types rather than variables, surrounded by parentheses
- how to check screen size of iphone 4 and iphone 5 programmatically in swift
- What is the difference between inheritance and Categories in Objective-C
- Container View Controller Examples [closed]
- Difference between framework and static library in xcode4, and how to call them
- Advantages, problems, examples of adding another UIWindow to an iOS app?
- Dynamically Updating a UILabel
- How is this form of scoping called? [duplicate]
- Swift readonly external, readwrite internal property
- Appending to the end of a file with NSMutableString
- Implementing -hash / -isEqual: / -isEqualTo…: for Objective-C collections
- Convert NSString into char array
- How can I tell when UITableView has completed ReloadData?
- How do I download and save a file locally on iOS using objective C? [duplicate]
- NSLog incorrect encoding
- iOS Screenshot part of the screen
- Can a Swift Optional Int (Int?) be exposed to Objective-C via bridging?
- How to Animate a UIBezierPath
- How can I get a hex string from UIColor or from rgb
- How does a Block capture the variables outside of its enclosing scope?
- MKPolygon area calculation
- How to make a smooth, rounded, volume-like OS X window with NSVisualEffectView?
- Weird error message in Xcode 4.3 with LLDB