ios - NSDATA 描述返回 nil

标签 ios objective-c nsdata xcode11 ios13

NSData 描述返回 nil 并使 NSData 对象为零。我的代码已停止工作,我想让它再次工作。

如果我在 Xcode 10 中编译我的代码,它将获得很好的 NSData 描述。但如果我使用 Xcode 11,它会给我 nil 作为描述,并且它也会使 NSData nil 。我对这是怎么发生的感到困惑。这是因为它仍然是测试版吗?这种事情在 Beta 版本中正常吗?我只是想确保我的代码在新的 iOS 13 和 iPAD OS 13 发布之前仍然有效。

NSString *result = [[数据描述] stringByReplacingOccurrencesOfString:@""withString:@""];

最佳答案

参见 https://twitter.com/steipete/status/1174111017900503040 - iOS 13 行为(在 GM 种子 2 时编写)。

正如其他人所说,您不应该以这种方式使用 [NSData description]。

关于ios - NSDATA 描述返回 nil,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56792123/

相关文章:

javascript - 如何在 iOS 自动化中访问 UITableView 中的单元格

ios - 如何禁用 SpriteKit 节点触摸事件,然后在 25 秒后启用它以被触摸并移动到下一个场景?

ios - Facebook权限崩溃

ios - 使用 NSURLSession 设计简单的 ios 应用程序

ios - 核心数据加密类

c# - 将 PDF 页面渲染到 CGBitmapContext 时如何减少内存使用?

ios - 运行的应用程序使 iPhone5S 崩溃并强制硬重置,仅在第二次启动时出现错误 "failed to get task for process"

ios - swift 中 NSRangeException 的错误处理

ios - UIImage AsPNG 和 AsJPEG 失败

ios - 用于通用 rest API 的 NSData 对象中的 JSON