美文网首页
重写系统description

重写系统description

作者: 搬码小能手 | 来源:发表于2017-08-28 17:30 被阅读22次
打印模型.png 打印模型林的字段.png 重写系统description.png
- (NSString*)description{

    return [NSString stringWithFormat:@"%@{%@}",[super description],self.name];

}

description到底是什么东西?


description.png

description不是关键字. description是NSObject提供的一个属性

declaration:
@property(readonly, copy) NSString *description;
Description 
Returns a string that describes the contents of the receiver.
This method is used to create a textual representation of an object, for example in a formatted string:
翻译:返回一个描述接收者内容的字符串。
该方法用于创建对象的文本表示,例如在格式化的字符串中:

相关文章

网友评论

      本文标题:重写系统description

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