美文网首页
对象占用的内存大小

对象占用的内存大小

作者: Jean_Lina | 来源:发表于2021-06-24 17:43 被阅读0次
    Person *person = [[Person alloc] init];
    NSLog(@"int %lu", sizeof(int));            //4
    NSLog(@"float %lu", sizeof(float));        //4
    NSLog(@"double %lu", sizeof(double));      //8
    NSLog(@"NSInteger %lu", sizeof(NSInteger));//8
    NSLog(@"CGFloat %lu", sizeof(CGFloat));    //8
    NSLog(@"person %lu", sizeof(person));      //8

相关文章

网友评论

      本文标题:对象占用的内存大小

      本文链接:https://www.haomeiwen.com/subject/vzkgyltx.html