简体   繁体   English

如何检查或查找是否可以在Xcode文档中使用内置方法

[英]How to check or find if there is inbuilt method I can use in xcode documentation

I am a recent xCode developer and I would like to know how to know or find methods like convert numberFromString available as in-built method in xCode which I can use rather trying to manually code with type cast and conversions. 我是xCode的新开发人员,我想知道如何知道或查找诸如convert numberFromString之类的方法,这些方法可以作为xCode的内置方法使用,而我可以使用它们尝试使用类型强制转换和转换手动进行编码。 Any suggestions to find such methods or best way to utilize xCode documentation ? 是否有找到这种方法的最佳建议或利用xCode文档的最佳方法?

Opening the documentation and manually searching for a method in that class or it's inherited classes is like searching a needle in the haystack. 打开文档并手动在该类或其继承的类中搜索方法,就像在大海捞针中搜索针头一样。 Can we search with keywords like 'convert number from string' and I will be notified of such equivalent methods in inherited classes ? 我们是否可以使用“从字符串转换数字”之类的关键字进行搜索,并且会在继承的类中收到此类等效方法的通知? Because say I was working with a string, get and set. 因为说我正在使用字符串,所以获取并设置。 But NSNumberFormatter class has numberFromString method. 但是NSNumberFormatter类具有numberFromString方法。 How will I be able to know of it's availability in such cases ? 在这种情况下,我如何知道它的可用性? Hope this was clear to put my difficulty in finding methods. 希望这很清楚,使我难以找到方法。

Two ways: 两种方式:

  1. Press the option key on the keyboard and click on the class you want to know about. 按键盘上的选项键,然后单击要了解的课程。 You'll get a nice popup with information. 您会看到一个漂亮的信息弹出窗口。

Or 2. For a more in depth experience, press command and click on the class, you'll go to the class definition with the the documentation in the right panel under quick help. 或2.要获得更深入的体验,请按Command键并单击课程,您将在右侧面板的快速帮助下转到包含文档的课程定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM