Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-16-2011, 11:22 AM   #1 (permalink)
Registered Member
 
TechnoEagle's Avatar
 
Join Date: Sep 2010
Posts: 69
TechnoEagle is on a distinguished road
Question custom NSCalendarUnit for UILocalNotification repeatInterval?

I am trying to make an instance of UILocalNotification have a repeatInterval of 5 minutes. Many people online have said to set the repeatInterval to 5*NSMinuteCalendarUnit. This doesn't work, and I am not surprised, since every NSCalendarUnit is a multiple of two, and NSHourCalendarUnit is half as big as NSMinuteCalendarUnit.

Does anyone know how to make the repeatInterval 5 minutes (or any other custom interval)??
TechnoEagle is offline   Reply With Quote
Old 05-11-2011, 02:51 PM   #2 (permalink)
iPhone Newbie
 
Join Date: Dec 2010
Location: Worcestershire, UK
Age: 24
Posts: 66
mwyld is on a distinguished road
Default

I'm having the same trouble. I need to do 2 weeks repeat interval. All I have to work with at the moment is a week or a month?
mwyld is offline   Reply With Quote
Old 05-11-2011, 03:14 PM   #3 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 864
nobre84 is on a distinguished road
Default

You could always schedule 2 notifications, 5 minutes apart from each other. The API is there for the repeatInterval, but so limited
nobre84 is offline   Reply With Quote
Old 05-11-2011, 03:43 PM   #4 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by TechnoEagle View Post
I am trying to make an instance of UILocalNotification have a repeatInterval of 5 minutes. Many people online have said to set the repeatInterval to 5*NSMinuteCalendarUnit. This doesn't work, and I am not surprised, since every NSCalendarUnit is a multiple of two, and NSHourCalendarUnit is half as big as NSMinuteCalendarUnit.

Does anyone know how to make the repeatInterval 5 minutes (or any other custom interval)??
Your only choice is to use one of the calendar units like minute, hour, day, week, month, etc. Those constants are bit values where each bit represents a calendar unit. You can't use an expression like 5*NSMinuteCalendarUnit.

You can specify a fire date explicitly with the fireDate property, but that's a one shot notification that doesn't repeat.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Reply

Bookmarks

Tags
help!, iphone sdk, nscalendarunit, uilocalnotification

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 362
10 members and 352 guests
7twenty7, blueorb, dre, iAppDeveloper, iGamesDev, Mah6447, Morrisone, mottdog, sacha1996, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:37 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0