NSNumber
//
// ViewController.m
// LearnNSNumber
//
// Created by 印林泉 on 2017/3/6.
// Copyright © 2017年 ylq. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"%@", [[NSNumber alloc] init]);///(null)
NSLog(@"%@", [NSNumber numberWithBool:YES]);///1
NSNumber *number = [NSNumber numberWithInt:100];
NSNumber *floatValue = [NSNumber numberWithFloat:100.0];
NSLog(@"%c", [number charValue]);
NSLog(@"%c", [floatValue charValue]);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
网友评论