久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <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="qwawimqqmiuu" id='2Pasu'><tfoot id='2Pasu'></tfoot><dl id='2Pasu'><fieldset id='2Pasu'></fieldset></dl></div>
    2. UILocalNotification 應(yīng)該在每個(gè)工作日重復(fù),但也會在

      UILocalNotification is supposed to repeat every weekday, but fires on weekends as well(UILocalNotification 應(yīng)該在每個(gè)工作日重復(fù),但也會在周末觸發(fā))
        <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="qwawimqqmiuu" 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 應(yīng)該在每個(gè)工作日重復(fù),但也會在周末觸發(fā)的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                限時(shí)送ChatGPT賬號..

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

                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 中的工作日僅表示一周中的一天.它沒有工作周";內(nèi)涵而不是周末.

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

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

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

                NSWeekdayCalendarUnit

                NSWeekdayCalendarUnit

                指定工作日單位.

                對應(yīng)的值為 kCFCalendarUnitSecond.等于 kCFCalendarUnitWeekday.工作日單位是從 1 到 N 的數(shù)字(對于公歷 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

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

                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;
                

                這篇關(guān)于UILocalNotification 應(yīng)該在每個(gè)工作日重復(fù),但也會在周末觸發(fā)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點(diǎn)擊動畫 UIImageview 以顯示全屏?)
                To stop segue and show alert(停止 segue 并顯示警報(bào))
                iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                Icon already includes gloss effects(圖標(biāo)已經(jīng)包含光澤效果)
                How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進(jìn)度圖像(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="qwawimqqmiuu" 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>
                        • 主站蜘蛛池模板: 精品二区视频 | 蜜桃五月天 | 99久久影院 | 日日夜夜免费精品视频 | 99re6热在线精品视频播放 | 国产 欧美 日韩 一区 | 一级免费在线视频 | 亚洲天堂成人在线视频 | 欧美性精品 | 成年视频在线观看福利资源 | 成年人在线观看视频 | 欧美精品欧美精品系列 | 欧美日韩国产一区二区三区 | 91视频大全 | 久久精品久久久久久 | 欧美vide| 国产欧美精品一区二区色综合 | 91久久久久 | 中文字幕视频在线看 | 一区二区三区国产精品 | 精品乱码一区二区三四区视频 | 一区二区三区日韩 | 亚洲成人av在线播放 | 国产一区在线免费 | 一区二区三区视频 | 国产黄色大片在线观看 | 日韩欧美在线一区 | 久久国产精品一区二区 | 2018天天干天天操 | 欧美精三区欧美精三区 | 日韩一区二区福利视频 | 国产www.| 一区二区精品 | 中文字幕一区在线观看视频 | 91久久精品国产 | 亚洲精品一区二区三区蜜桃久 | 香蕉视频一区二区 | 综合一区二区三区 | 欧美久久久久久 | 国产精品一卡 | 亚洲高清在线 |