objective-c – 折旧的NSNibLoading方法的替换(loadNibFile :, loadNibNamed:等)?

objective-c – 折旧的NSNibLoading方法的替换(loadNibFile :, loadNibNamed:等)?,第1张

概述我发现NSBundle中的NSNibLoading方法: +[NSBundle loadNibFile:externalNameTable:withZone:]+[NSBundle loadNibNamed:owner:]-[NSBundle loadNibFile:externalNameTable:withZone:] 在10.8中都被标记为不赞成 – 在10.8及更高版本中加载笔尖的正确 我发现NSBundle中的NSNibLoading方法:

+[NSBundle loadNibfile:externalnametable:withZone:]+[NSBundle loadNibnamed:owner:]-[NSBundle loadNibfile:externalnametable:withZone:]

在10.8中都被标记为不赞成 – 在10.8及更高版本中加载笔尖的正确方法是什么?

我试图在我的应用程序中创建一个自定义工作表,我必须用自定义工作表的initWithWindowNibname创建NSWindowController吗?

解决方法 NSBundle类方法loadNibnamed:owner:在OS X v10.8中已被弃用,
loadNibnamed:owner:topLevelObjects:不是和注释 in the documentation状态为什么:

Unlike legacy methods,the objects adhere to the standard cocoa memory management rules; it is necessary to keep a strong reference to them by using IBOutlets or holding a reference to the array to prevent the nib contents from being deallocated.

总结

以上是内存溢出为你收集整理的objective-c – 折旧的NSNibLoading方法的替换(loadNibFile :, loadNibNamed:等)?全部内容,希望文章能够帮你解决objective-c – 折旧的NSNibLoading方法的替换(loadNibFile :, loadNibNamed:等)?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1030330.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存