Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
stefan_kendall
on Oct 10, 2013
|
parent
|
context
|
favorite
| on:
Show HN: NSString + Ruby
I use the same thing to construct NSDecimalNumber instances. N(100.5) instead of [NSDecimalNumber decimalNumberFromString:@"100.5"]
SO handy.
bennyg
on Oct 11, 2013
[–]
You can do this now @(100.5) for NSNumber literals.
dennis_vartan
on Oct 11, 2013
|
parent
[–]
And even shorter, just @100.5 if what you have is a literal. The parentheses are needed if you're boxing a value, e.g.: @(price + 100.5)
In detail:
http://clang.llvm.org/docs/ObjectiveCLiterals.html
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
SO handy.