pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <bdo id='2Pasu'></bdo><ul id='2Pasu'></ul>
  1. <small id='2Pasu'></small><noframes id='2Pasu'>

      <tfoot id='2Pasu'></tfoot>

    1. <legend id='2Pasu'><style id='2Pasu'><dir id='2Pasu'><q id='2Pasu'></q></dir></style></legend>
      <i id='2Pasu'><tr id='2Pasu'><dt id='2Pasu'><q id='2Pasu'><span id='2Pasu'><b id='2Pasu'><form id='2Pasu'><ins id='2Pasu'></ins><ul id='2Pasu'></ul><sub id='2Pasu'></sub></form><legend id='2Pasu'></legend><bdo id='2Pasu'><pre id='2Pasu'><center id='2Pasu'></center></pre></bdo></b><th id='2Pasu'></th></span></q></dt></tr></i><div class="umgokw2" id='2Pasu'><tfoot id='2Pasu'></tfoot><dl id='2Pasu'><fieldset id='2Pasu'></fieldset></dl></div>
    2. UILocalNotification 應該在每個工作日重復,但也會在

      UILocalNotification is supposed to repeat every weekday, but fires on weekends as well(UILocalNotification 應該在每個工作日重復,但也會在周末觸發)
        <tfoot id='xA0iG'></tfoot>
            <tbody id='xA0iG'></tbody>
        • <small id='xA0iG'></small><noframes id='xA0iG'>

          <legend id='xA0iG'><style id='xA0iG'><dir id='xA0iG'><q id='xA0iG'></q></dir></style></legend>

          • <i id='xA0iG'><tr id='xA0iG'><dt id='xA0iG'><q id='xA0iG'><span id='xA0iG'><b id='xA0iG'><form id='xA0iG'><ins id='xA0iG'></ins><ul id='xA0iG'></ul><sub id='xA0iG'></sub></form><legend id='xA0iG'></legend><bdo id='xA0iG'><pre id='xA0iG'><center id='xA0iG'></center></pre></bdo></b><th id='xA0iG'></th></span></q></dt></tr></i><div class="ywiqmgi" id='xA0iG'><tfoot id='xA0iG'></tfoot><dl id='xA0iG'><fieldset id='xA0iG'></fieldset></dl></div>

              <bdo id='xA0iG'></bdo><ul id='xA0iG'></ul>

              1. 本文介紹了UILocalNotification 應該在每個工作日重復,但也會在周末觸發的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我有一個 UILocalNotification 應該每天觸發一次,從周一到周五,但不是在周末.我認為將通知的 repeatInterval 屬性設置為 NSWeekdayCalendarUnit 可以完成此操作.對我來說可悲的是,我的通知仍然在周末觸發.誰能建議為什么?這是我的代碼:

                I have a UILocalNotification that is supposed to fire once a day, Monday through Friday, but not on the weekend. I thought that setting the repeatInterval property of the notification to NSWeekdayCalendarUnit would accomplish this. Sadly for me, my notifications are still firing on the weekend. Can anyone suggest why? Here is my code:

                UILocalNotification *localNotification = [[UILocalNotification alloc] init];
                
                localNotification.alertAction = @"View";
                localNotification.alertBody = NSLocalizedString(@"ALERT_MESSAGE", nil);
                localNotification.soundName = UILocalNotificationDefaultSoundName;
                
                NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
                [dateFormatter setDateFormat:@"MM-dd-yyyy HH:mm"];
                [dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"America/Toronto"]];
                
                // Notification fire times are set by creating a notification whose fire date 
                // is an arbitrary weekday at the correct time, and having it repeat every weekday
                NSDate *fireDate = [dateFormatter dateFromString:@"01-04-2012 11:00"]; 
                
                localNotification.fireDate = fireDate;
                localNotification.repeatInterval = NSWeekdayCalendarUnit;
                [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
                            break;
                
                [localNotification release];
                

                推薦答案

                iOS 中的工作日僅表示一周中的一天.它沒有工作周";內涵而不是周末.

                Weekday in iOS just means a day inside of a week. It doesn't have the "work week" connotation as opposed to a weekend.

                文檔說得更清楚一點,建議您使用 1-7 作為單位:

                The documentation says it a little clearer, by suggesting that you use 1-7 as the units:

                NSWeekdayCalendarUnit

                NSWeekdayCalendarUnit

                指定工作日單位.

                對應的值為 kCFCalendarUnitSecond.等于 kCFCalendarUnitWeekday.工作日單位是從 1 到 N 的數字(對于公歷 N=7,1 是星期日).

                The corresponding value is an kCFCalendarUnitSecond. Equal to kCFCalendarUnitWeekday. The weekday units are the numbers 1 through N (where for the Gregorian calendar N=7 and 1 is Sunday).

                來源:http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSCalendar_Class/Reference/NSCalendar.html

                為了正確設置周一到周五的通知,這里有一些框架代碼.你必須執行 5 次,所以最好將它封裝在一個為 fireDate 提供參數的方法中.我已經向你展示了如何在星期一做到這一點.

                To properly set your notifications from Monday through Friday, here's some skeleton code. Yo'll have to execute it 5 times, so it'd be good to encapsulate it inside of a method that parameters for the fireDate. I've shown how you could do it for Monday.

                UILocalNotification *notification = [[[UILocalNotification alloc] init] autorelease];
                
                // Set this to an NSDate that is for the time you want, on Monday
                notification.fireDate = fireDate;            
                
                // Repeat every week
                notification.repeatInterval = NSWeekCalendarUnit;
                

                這篇關于UILocalNotification 應該在每個工作日重復,但也會在周末觸發的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                To stop segue and show alert(停止 segue 并顯示警報)
                iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                Icon already includes gloss effects(圖標已經包含光澤效果)
                How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))
              2. <i id='cH3h6'><tr id='cH3h6'><dt id='cH3h6'><q id='cH3h6'><span id='cH3h6'><b id='cH3h6'><form id='cH3h6'><ins id='cH3h6'></ins><ul id='cH3h6'></ul><sub id='cH3h6'></sub></form><legend id='cH3h6'></legend><bdo id='cH3h6'><pre id='cH3h6'><center id='cH3h6'></center></pre></bdo></b><th id='cH3h6'></th></span></q></dt></tr></i><div class="kwa0meo" id='cH3h6'><tfoot id='cH3h6'></tfoot><dl id='cH3h6'><fieldset id='cH3h6'></fieldset></dl></div>

                <small id='cH3h6'></small><noframes id='cH3h6'>

                    <tbody id='cH3h6'></tbody>

                          <bdo id='cH3h6'></bdo><ul id='cH3h6'></ul>
                          <legend id='cH3h6'><style id='cH3h6'><dir id='cH3h6'><q id='cH3h6'></q></dir></style></legend>
                          <tfoot id='cH3h6'></tfoot>
                        • 主站蜘蛛池模板: 杭州货架订做_组合货架公司_货位式货架_贯通式_重型仓储_工厂货架_货架销售厂家_杭州永诚货架有限公司 | 铝合金风口-玻璃钢轴流风机-玻璃钢屋顶风机-德州东润空调设备有限公司 | 卧涛科技有限公司科技项目申报公司|高新技术企业申报|专利申请 | 不锈钢拉手厂家|浴室门拉手厂家|江门市蓬江区金志翔五金制品有限公司 | 定量包装机,颗粒定量包装机,粉剂定量包装机,背封颗粒包装机,定量灌装机-上海铸衡电子科技有限公司 | 天津市能谱科技有限公司-专业的红外光谱仪_红外测油仪_紫外测油仪_红外制样附件_傅里叶红外光谱技术生产服务厂商 | 齿轮减速机电机一体机_齿轮减速箱加电机一体化-德国BOSERL蜗轮蜗杆减速机电机生产厂家 | 翻斗式矿车|固定式矿车|曲轨侧卸式矿车|梭式矿车|矿车配件-山东卓力矿车生产厂家 | 航空连接器,航空插头,航空插座,航空接插件,航插_深圳鸿万科 | 警方提醒:赣州约炮论坛真的安全吗?2025年新手必看的网络交友防坑指南 | 非小号行情 - 专业的区块链、数字藏品行情APP、金色财经官网 | 山东彩钢板房,山东彩钢活动房,临沂彩钢房-临沂市贵通钢结构工程有限公司 | 苏州工作服定做-工作服定制-工作服厂家网站-尺品服饰科技(苏州)有限公司 | 电缆隧道在线监测-智慧配电站房-升压站在线监测-江苏久创电气科技有限公司 | 【德信自动化】点胶机_全自动点胶机_自动点胶机厂家_塑料热压机_自动螺丝机-深圳市德信自动化设备有限公司 | Safety light curtain|Belt Sway Switches|Pull Rope Switch|ultrasonic flaw detector-Shandong Zhuoxin Machinery Co., Ltd | 深圳办公室装修-写字楼装修设计-深圳标榜装饰公司 | 手持式浮游菌采样器-全排二级生物安全柜-浙江孚夏医疗科技有限公司 | 天津市能谱科技有限公司-专业的红外光谱仪_红外测油仪_紫外测油仪_红外制样附件_傅里叶红外光谱技术生产服务厂商 | 「阿尔法设计官网」工业设计_产品设计_产品外观设计 深圳工业设计公司 | 控显科技 - 工控一体机、工业显示器、工业平板电脑源头厂家 | 环压强度试验机-拉链拉力试验机-上海倾技仪器仪表科技有限公司 | 有声小说,听书,听小说资源库-听世界网 | 热熔胶网膜|pes热熔网膜价格|eva热熔胶膜|热熔胶膜|tpu热熔胶膜厂家-苏州惠洋胶粘制品有限公司 | 广东风淋室_广东风淋室厂家_广东风淋室价格_广州开源_传递窗_FFU-广州开源净化科技有限公司 | 无缝钢管-聊城无缝钢管-小口径无缝钢管-大口径无缝钢管 - 聊城宽达钢管有限公司 | 【星耀裂变】_企微SCRM_任务宝_视频号分销裂变_企业微信裂变增长_私域流量_裂变营销 | 磁力加热搅拌器-多工位|大功率|数显恒温磁力搅拌器-司乐仪器官网 | 家德利门业,家居安全门,别墅大门 - 安徽家德利门业有限公司 | 合肥展厅设计-安徽展台设计-合肥展览公司-安徽奥美展览工程有限公司 | 胀套-锁紧盘-风电锁紧盘-蛇形联轴器「厂家」-瑞安市宝德隆机械配件有限公司 | 广东成考网-广东成人高考网| app开发|app开发公司|小程序开发|物联网开发||北京网站制作|--前潮网络 | 预制围墙_工程预制围墙_天津市瑞通建筑材料有限公司 | 高尔夫球杆_高尔夫果岭_高尔夫用品-深圳市新高品体育用品有限公司 | 餐饮加盟网_特色餐饮连锁加盟店-餐饮加盟官网 | 天津试验仪器-电液伺服万能材料试验机,恒温恒湿标准养护箱,水泥恒应力压力试验机-天津鑫高伟业科技有限公司 | 百方网-百方电气网,电工电气行业专业的B2B电子商务平台 | 熔体泵_熔体出料泵_高温熔体泵-郑州海科熔体泵有限公司 | 路面机械厂家 | 小型高低温循环试验箱-可程式高低温湿热交变试验箱-东莞市拓德环境测试设备有限公司 |