这种 iPhone 编程方法叫什么?
我有一个示例代码,其中:
- 我无法理解数据如何从数据库流向报告,因为没有地方可以显式设置或获取数据。这一切都是通过自定义对象完成的。
- 即使我们无法使用 NSLog 通过控制台获取数据,因为它具有 ENUM 键
- 所有对象都是自定义对象,因此如果我们将其放入 NSLogs 中,我们会得到类似
< CustomObject-hexcode>
。许多类又包含其他类的对象。 - 即使我尝试通过设置断点来调试代码,但经过几个步骤后它会显示十六进制代码,
我将无法放置示例代码,因为它是一个包含大量文件的整个项目。
您能告诉我使用了什么样的方法吗?它看起来像是某种封装。
谢谢!
I have a sample code wherein:
- I am unable to understand how data flows from database to reports because there is no place to set or fetch data explicitly. It is all done through custom objects.
- Even we are not able to fetch data through console using NSLog as it has ENUM keys
- All objects are custom objects so if we put it in NSLogs we get structure like
< CustomObject-hexcode>
. Many of the classes again comprise of objects from other classes. - Even if I try to debug code by putting breakpoint, then after few steps it show Hexadecimal codes
I wont be able to put sample code as it is a whole project containing lot of files.
Can you please let me know what kind of approach has been used? It looks like some sort of encapsulation.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为每个自定义对象编写实现
- (NSString* ) description
方法的类别,以显示自定义对象保存的所有变量,您可以将每个枚举值转换为字符串。然后就可以使用NSLog来输出对象并得到可读的结果。Write categories that implement the
- (NSString* ) description
method for each custom object that displays all variables the custom obejects hold, you can there translate each of the enum values to strings. Then you can use NSLog to output objects and get readable results.您需要调试应用程序。对于这个“所有对象都是自定义对象,因此如果我们将其放入 NSLogs 中,我们会得到类似的结构”
您需要在项目中集成一个类别类。在 google 上搜索 nsobject 的覆盖描述。您将获得正确格式的 nslog。
you need to debug application. and for this "All objects are custom objects so if we put it in NSLogs we get structure like < CustomObject-hexcode>"
you need to integrate a category class in your project. Search on google for override description of nsobject. You will get nslog in proper format.
这听起来像是某种具有序列化/反序列化等功能的自定义 ORM。Euuuwww。
It sounds like some kind of custom ORM with serialization / deserialization etc. Euuuwww.