gpt4 book ai didi

ios - 如何根据时间调用2个号码

转载 作者:行者123 更新时间:2023-12-01 18:06:04 24 4
gpt4 key购买 nike

抱歉我对 iOS 不熟悉的所有问题,但我想知道是否可以在 iOS 中设置时间范围,例如,如果用户在早上 6 点到下午 6 点之间按下按钮调用我,拨号器打开并调用 nr 567895432 但如果例如下类后 6,01pm - 7,59am
如果按下按钮调用我,用户将调用 89780324,我知道如果我应该创建一个 Webview 应用程序,这在 php 上是可能的,但这是一个 native 应用程序,我真的不想访问数据库,只是一个简单的 2way 应用程序发送要求,
先感谢您

最佳答案

如果我理解正确,点击按钮,您想根据时间调用两个不同的号码。
你为什么不检查按钮按下

NSDateComponents *components = [[NSCalendar currentCalendar] components:NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit fromDate:[NSDate date]];
NSInteger currentHour = [components hour];
NSInteger currentMinute = [components minute];
NSInteger currentSecond = [components second];

if ((currentHour > 6) && (currentHour < 18)) {
call 567895432
}
else{
call 89780324
}

关于ios - 如何根据时间调用2个号码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44134714/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com