菜鸟教程小白 发表于 2022-12-12 23:11:05

ios - Objective C 中 kCFCalendarUnitDay 和 NSCalendarUnitDay 的区别


                                            <p><p>我想问一下Objective C中的kCFCalendarUnitDay和NSCalendarUnitDay有什么区别?我打算用它在一天中的特定时间触发本地通知。我在想,哪个更适合使用?我希望你能帮助我选择。提前谢谢各位!</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>NSCalendarUnitDay 正在 Foundation Framework 中使用</p>

<p>kCFCalendarUnitDay 被用于核心基础框架</p>

<p>CF 表示“核心基础”</p>

<p>k 表示常数。那是苹果的约定,同时代表常数</p>

<p>NSCalendarUnitDay 常量从核心基础框架的“kCFCalendarUnitDay”常量初始化。 </p>

<p><strong>它们都相同并代表相同的常数。</strong></p>

<p><strong>我建议你使用 Foundation Framework 的 NSCalendarUnitDay</strong></p>

<p>请参阅随附的屏幕截图。</p>

<p> <img src="/image/sb1DL.png" alt="enter image description here"/>
<img src="/image/j2UKT.png" alt="enter image description here"/> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Objective C 中 kCFCalendarUnitDay 和 NSCalendarUnitDay 的区别,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/24361101/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/24361101/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Objective C 中 kCFCalendarUnitDay 和 NSCalendarUnitDay 的区别