菜鸟教程小白 发表于 2022-12-13 14:13:54

ios - 如何在 View Controller 中使用自定义类?


                                            <p><p>好的,我为我的项目创建了一些来自 <a href="http://josebolanos.wordpress.com/2012/03/16/core-data-passwords-in-keychain/" rel="noreferrer noopener nofollow">this tutorial</a> 的自定义类,我想如果我想在我的 <em>ViewControllerWelcome.m</em> 文件中使用这个类,我需要首先使用以下文件在文件顶部导入该类:
<code>#import "KeychainHelper.h</code></p>

<p>完成后,我在 <em>ViewControllerWelcome.m</em> 文件中创建一个 Keychainhelper 对象,并使用以下 <code>KeychainHelper *keychainhelper = [init];</code> </p>

<p>现在我想检查用户在文本字段中输入的 pin 与存储在钥匙串(keychain)中的 pin。 KeychainHelper 类有一个方法
<code>+ (NSString*)getPasswordForKey:(NSString*)aKey;</code> 但我不确定如何在我的 <em>ViewControllerWelcome.m</em> 文件中使用/实现/向此方法发送消息.</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您应该能够做到以下几点:</p>

<pre><code>NSString *password =
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 如何在 ViewController 中使用自定义类?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/11067163/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/11067163/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 如何在 View Controller 中使用自定义类?