Created
October 1, 2012 21:06
-
-
Save C4Code/3814419 to your computer and use it in GitHub Desktop.
NSNumbers and NSStrings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// C4WorkSpace.m | |
// numbersStrings | |
// | |
// Created by moi on 12-10-01. | |
// Copyright (c) 2012 moi. All rights reserved. | |
// | |
#import "C4WorkSpace.h" | |
@implementation C4WorkSpace | |
-(void)setup { | |
NSString *s = [NSString stringWithFormat:@"%d",1]; | |
C4Log(@"%@",s); | |
s = [s stringByAppendingFormat:@"%d",2]; | |
C4Log(@"%@",s); | |
NSNumber *n = [NSNumber numberWithInt:3]; | |
C4Log(@"%@",n); | |
C4Log(@"%d",[n intValue]); | |
C4Log(@"%4.2f",[n floatValue]); | |
NSString *s2 = [n stringValue]; | |
C4Log(@"%@",s2); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment