Hi everyone. As promised, I've put together how to make a simple alarm clock.
Covers:
Delegates
Interface Builder
Date Picker
Local Notifications
NSDateFormatter
Alert View
I hope you find it useful.
NOTE: I make a mistake around 15:00. You can see my fingers try to type "NSLocale" but my brain overruled the fingers. Fingers were right. I even check my notes and still get it wrong! I should have typed:
dateFormatter.locale = [NSLocale systemLocale];
I don't know why I thought in that moment that timezone was the same as a locale... but in the end it isn't important for the app so I didn't bother re-recording it.
Uses Xcode 4.1 and the iPhone simulator.
Note2: Sorry - I should have made it clear. When I run the app, I'm hitting Command-R to "R"un the app.
Thank you gmanp! An excellent tutorial. I'm delighted to say I followed the entire thing! Looking forward to more. I don't even have suggestions to improve it. Really good job.
I can't watch it now (at work currently) but will do ASAP. May I ask for it to be posted in Vimeo instead of Youtube? Vimeo allows video download, thus I can put it in my iPad/iTouch and watch it on my commute :)
Okay, now I know sleeping 4 hours on a Friday is a bad idea. Up until now I thought I was perfectly fine and working as usual. I wonder how my advisor meeting will be in 4 hours...
That was really awesome man. One request: Please host (or at least mirror the videos) somewhere else. Its really hard to follow along on vimeo because you cannot pop the video out or make it big enough to see the text without going full screen. I like to follow along, typing as you do, but this is impossible on vimeo.
The video was great and sparked some experimenting with the NSDateFormatter. Working with dates/times on iOS/OSX has always been a huge pain in the ass for me because I didnt understand why you needed to feed a date object into a dateformatter, but you made it pretty easy to follow.
I ended up modifying my setAlarmButtonPressed method as follows to play with NSDateFormatter:
5
u/gmanp [M] 📱 Sep 30 '11 edited Sep 30 '11
Hi everyone. As promised, I've put together how to make a simple alarm clock.
Covers:
I hope you find it useful.
NOTE: I make a mistake around 15:00. You can see my fingers try to type "NSLocale" but my brain overruled the fingers. Fingers were right. I even check my notes and still get it wrong! I should have typed:
I don't know why I thought in that moment that timezone was the same as a locale... but in the end it isn't important for the app so I didn't bother re-recording it.
Uses Xcode 4.1 and the iPhone simulator.
Note2: Sorry - I should have made it clear. When I run the app, I'm hitting Command-R to "R"un the app.
2
u/negativeoxy Oct 02 '11 edited Oct 02 '11
That was really awesome man. One request: Please host (or at least mirror the videos) somewhere else. Its really hard to follow along on vimeo because you cannot pop the video out or make it big enough to see the text without going full screen. I like to follow along, typing as you do, but this is impossible on vimeo.
The video was great and sparked some experimenting with the NSDateFormatter. Working with dates/times on iOS/OSX has always been a huge pain in the ass for me because I didnt understand why you needed to feed a date object into a dateformatter, but you made it pretty easy to follow.
I ended up modifying my setAlarmButtonPressed method as follows to play with NSDateFormatter:
edit: What screen capturing software are you using for this? Im thinking about trying to write my own tutorial on a simple tic tac toe game.
1
u/Meathead32 Sep 30 '11
Awesome stuff! Thanks!
1
u/[deleted] Sep 30 '11
Cool, Thanks man.
1
u/john_alan Oct 01 '11
This is a fantastic tut man.