NSURLRequest到NSString [英] NSURLRequest to NSString

查看:242
本文介绍了NSURLRequest到NSString的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将NSURLRequest转换为NSString?

how can i convert NSURLRequest to NSString ?

推荐答案

取决于你想要的字符串中的信息。你想让它包含对象中的实例变量的所有值吗?如果是这样,你需要编写自己的方法。也许子类 NSURLRequest 并覆盖 description 。您还可以使用反射来获取所有私有的ivars并打印出另一个类的所有内容。

Depends on the information you want in the string. Do you want to have it contain all the values of the instance variables in the object? If so, you're going to need to write your own method that does that. Perhaps subclass NSURLRequest and override description. You could also use reflection to get at all the private ivars and print everything out from another class.

或者只需使用调试器检查值。

Or just use a debugger to inspect the values.

这篇关于NSURLRequest到NSString的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆