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>
                        • 主站蜘蛛池模板: 河南中整光饰机械有限公司-抛光机,去毛刺抛光机,精密镜面抛光机,全自动抛光机械设备 | 海德莱电力(HYDELEY)-无功补偿元器件生产厂家-二十年专业从事电力电容器 | 昊宇水工|河北昊宇水工机械工程有限公司| 黑田精工电磁阀-CAMMOZI气缸-ROSS电磁-上海茂硕机械设备有限公司 | 有源电力滤波装置-电力有源滤波器-低压穿排电流互感器|安科瑞 | 体检车_移动CT车_CT检查车_CT车_深圳市艾克瑞电气有限公司移动CT体检车厂家-深圳市艾克瑞电气有限公司 | LED灯杆屏_LED广告机_户外LED广告机_智慧灯杆_智慧路灯-太龙智显科技(深圳)有限公司 | KBX-220倾斜开关|KBW-220P/L跑偏开关|拉绳开关|DHJY-I隔爆打滑开关|溜槽堵塞开关|欠速开关|声光报警器-山东卓信有限公司 | 赛默飞Thermo veritiproPCR仪|ProFlex3 x 32PCR系统|Countess3细胞计数仪|371|3111二氧化碳培养箱|Mirco17R|Mirco21R离心机|仟诺生物 | 印刷人才网 印刷、包装、造纸,中国80%的印刷企业人才招聘选印刷人才网! | 亿立分板机_曲线_锯片式_走刀_在线式全自动_铣刀_在线V槽分板机-杭州亿协智能装备有限公司 | 重庆轻质隔墙板-重庆安吉升科技有限公司 | 不锈钢复合板厂家_钛钢复合板批发_铜铝复合板供应-威海泓方金属复合材料股份有限公司 | 电动葫芦-河北悍象起重机械有限公司 | 薪动-人力资源公司-灵活用工薪资代发-费用结算-残保金优化-北京秒付科技有限公司 | 彩超机-黑白B超机-便携兽用B超机-多普勒彩超机价格「大为彩超」厂家 | 细胞染色-流式双标-试剂盒免费代做-上海研谨生物科技有限公司 | 智成电子深圳tdk一级代理-提供TDK电容电感贴片蜂鸣器磁芯lambda电源代理经销,TDK代理商有哪些TDK一级代理商排名查询。-深圳tdk一级代理 | 温州在线网| 定制异形重型钢格栅板/钢格板_定做踏步板/排水沟盖板_钢格栅板批发厂家-河北圣墨金属制品有限公司 | 今日热点_实时热点_奇闻异事_趣闻趣事_灵异事件 - 奇闻事件 | 重庆磨床过滤机,重庆纸带过滤机,机床伸缩钣金,重庆机床钣金护罩-重庆达鸿兴精密机械制造有限公司 | 医院专用门厂家报价-医用病房门尺寸大全-抗菌木门品牌推荐 | 宁波普瑞思邻苯二甲酸盐检测仪,ROHS2.0检测设备,ROHS2.0测试仪厂家 | 5L旋转蒸发器-20L-50L旋转蒸发器-上海越众仪器设备有限公司 | 【德信自动化】点胶机_全自动点胶机_自动点胶机厂家_塑料热压机_自动螺丝机-深圳市德信自动化设备有限公司 | 搜木网 - 木业全产业链交易平台,免费搜货、低价买货! | 硅胶管挤出机厂家_硅胶挤出机生产线_硅胶条挤出机_臣泽智能装备 贵州科比特-防雷公司厂家提供贵州防雷工程,防雷检测,防雷接地,防雷设备价格,防雷产品报价服务-贵州防雷检测公司 | 中图网(原中国图书网):网上书店,尾货特色书店,30万种特价书低至2折! | 杭州货架订做_组合货架公司_货位式货架_贯通式_重型仓储_工厂货架_货架销售厂家_杭州永诚货架有限公司 | 土壤墒情监测站_土壤墒情监测仪_土壤墒情监测系统_管式土壤墒情站-山东风途物联网 | 直读光谱仪,光谱分析仪,手持式光谱仪,碳硫分析仪,创想仪器官网 | 深圳天际源广告-形象堆头,企业文化墙,喷绘,门头招牌设计制作专家 | 无线遥控更衣吊篮_IC卡更衣吊篮_电动更衣吊篮配件_煤矿更衣吊篮-力得电子 | 数年网路-免费在线工具您的在线工具箱-shuyear.com | 高空重型升降平台_高空液压举升平台_高空作业平台_移动式升降机-河南华鹰机械设备有限公司 | 砂石生产线_石料生产线设备_制砂生产线设备价格_生产厂家-河南中誉鼎力智能装备有限公司 | 即用型透析袋,透析袋夹子,药敏纸片,L型涂布棒-上海桥星贸易有限公司 | 精密五金冲压件_深圳五金冲压厂_钣金加工厂_五金模具加工-诚瑞丰科技股份有限公司 | 农产品溯源系统_农产品质量安全追溯系统_溯源系统 | 必胜高考网_全国高考备考和志愿填报信息平台 |