重写description方法

//重写description方法
//description建议大家在实际开发中都要重写这种方法。然后将类中有意义的成员变量打印出来,这样很方便我们调试程序
-(NSString *)description
{
    //优化 return [NSString stringWithFormat:@"我的cpu=%.1f我的内部存储是=%.1fMB",_cpu,_ram];
    NSString *result = [NSString stringWithFormat:@"我的cpu=%.1f我的内部存储是=%.1fMB",_cpu,_ram];
    return result;
    return @"ffffffff";
}

原文地址:https://www.cnblogs.com/tlnshuju/p/7076359.html