iOS 24 Hour date format

If you are using NSDateFormatter to send dates back to a server be VERY careful.  Specifying a date format string as follows…

@”yyyy-MM-dd’T’HH:mm:ss”

and the time for example is currently  09/10/2013  14:00:00, if the user has set their clock to be a 12-hour clock, instead of the default 24-hour clock. You will get a string back of…

2013-10-09T02:00:00 PM

The users preferences overwrite what you are asking for!!

Read the following documentation – https://developer.apple.com/library/ios/documentation/cocoa/Conceptual/DataFormatting/Articles/dfDateFormatting10_4.html

The following sample code from that article will always return a 24-hour clock value regardless of user preferences

<br /><br />NSDateFormatter *rfc3339DateFormatter = [[NSDateFormatter alloc] init];<br /><br />NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];<br /><br />[rfc3339DateFormatter setLocale:enUSPOSIXLocale];<br /><br />[rfc3339DateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss"];<br /><br />[rfc3339DateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];<br /><br />NSDate *date = [rfc3339DateFormatter dateFromString:rfc3339DateTimeString];<br /><br />

WWDC 2012 – Post Mortem

WWDC
As always at the WWDC there is a lot going on and a lot of information to try to digest to make the trip worthwhile. But this year there also appeared to be a lot more attendees than the last 2 times I’ve been, which lead to a lot of queuing! It took a couple of days for Apple to get on top of this, but by the end of the week we were organised into orderly lines.

The sessions, which I can’t talk about as all attendees are under an NDA, were good and new topics covered in enough detail to get you started. I get the feeling that the vast majority of attendees are now purely iOS focused rather than OS X, which means the iOS sessions tend to be packed. This lead to the annoying habit of a lot of people leaving 5 minutes before the current session finished, which seemed really rude, not only to the presenters but to the rest of us trying to actually listen to the last 5 minutes.

Community
I met a few new developers and caught up with some from previous years, which I find really helpful. As I’m a freelancer I tend to work on my own most of the time and having a network of fellow developers to communicate with helps with your sanity.

Special Guest
The end of the week finished with a lunchtime talk by ????????? (sorry NDA), he is an amazing and funny story-teller, I really wished that Apple recorded those sessions as well. Something that struck me during his talk, he used to make super 8 films when he was a kid, and I got the impression that other kids in his school thought of him as weird and geeky and therefore not in the “popular/cool group”. Which reminded me of me when I was a kid, computers were very very geeky back in 1981 and the ZX81, and most other kids thought this a bit “weird”. Now days with everyone using apps on a daily basis, showing there friends these cool apps they are using, doesn’t that make us geeks the cool kids?

Takeaway
What I’ve taken away from this year…

  1. Watch last years videos, make time in my weekly schedule to actually watch the videos, there is a lot of information in them, some of which won’t of changed much this year
  2. Make time to work on my own projects, client work is very important, it pays the bills, but I also need to be creating my own work
  3. Have faith, I love what I do, I need to put that love into what I create
  4. Watch this years videos, when they come out
  5. Start saving for next years!

Feedback
This year Apple have asked for feedback on the sessions, but I’ve given this general feedback for the conference as a whole…

  1. The sessions tend to be 80% talking and 20% demo, I’m sure we could get a lot more out of them if it was the other way around. Rather showing as a line of code on the slide, telling us what it does, this could be done while creating a demo. Seeing things work is more informative, we can always download the demo code afterwards?
  2. “Lines” seemed to be a real issue this year, spent a lot of time queuing just to get into sessions which left little time to have a break between sessions
  3. WiFi coverage was very bad
  4. This may seem like a silly thing, but it would be great if the WWDC app could have a playlist of the tracks that are played before sessions start. I know a lot of developers (including me) use Shazam to find out the names, that must stretch the WiFi and also kills our data plan

WWDC2012 – How Did My Predictions Score

Before I went to WWDC I came up with the following wish list of improvements/features that were hopefully going to be announced this year…

  1. Ability to run apps on the Apple TV and use your iOS device as a controller, including multiple devices at the same time
  2. Open up Siri to 3rd party apps, although how they work out which app gets to answer the question could be interesting
  3. NFC, this could open up some interesting projects
  4. Allow companies to create internal documentation using iBooks and give them a secure way of distributing those documents to staff
  5. Increase the number of testing devices that can be used
  6. Improved battery life on the iPhone
  7. 4G iPhone, but at the moment I’m not fussed either way, being based in the UK
  8. A nicer gift, like a limited edition iPad (I can dream)
  9. Move away from Google Maps
  10. Ability to use maps offline

So how did I do…

  1. Apps Running on Apple TV, turns out you can already do this, but its by using the Second Screen feature that is in iOS. I just need to think differently – YES (sort of)
  2. Siri to 3rd party apps – YES (I think I remember that from the Keynote?)
  3. NFC – NO
  4. Internal iBook Documents – NO
  5. Increase the number of testing devices – NO
  6. Improved Battery Life – NO
  7. 4G Phone – NO
  8. Nicer gift – NO, I now have a black jacket with a number 12 on it to go with the one that has a number 10 on it
  9. Move away from Google Maps – YES
  10. Offline maps – NO

So thats a grand total of 3/10 and one of those I could of already of done!

WWDC 2012 – Apple TV Apps

I’m lucky enough to be attending the WWDC this year, as it reaches closer to the “day of the long queue” my thoughts are turning to what I hope will be announced at the conference. So here they are in no real order (apart from the first one)

  1. Ability to run apps on the Apple TV and use your iOS device as a controller, including multiple devices at the same time
  2. Open up Siri to 3rd party apps, although how they work out which app gets to answer the question could be interesting
  3. NFC, this could open up some interesting projects
  4. Allow companies to create internal documentation using iBooks and give them a secure way of distributing those documents to staff
  5. Increase the number of testing devices that can be used
  6. Improved battery life on the iPhone
  7. 4G iPhone, but at the moment I’m not fussed either way, being based in the UK
  8. A nicer gift, like a limited edition iPad (I can dream)

I’ll add to the list as I think of things, but its a start, wonder if any of them will come true.

UPDATES:

  • Move away from Google Maps, with the ability to use maps offline

Let me know what you hope to see announced?

See what I do

Úll Conference – Review

I’ve just come back from Dublin, Ireland, where I attended the Úll Conference to cover all things iOS related. When the tickets where first released, the conference was advertised as a 3 day affair, starting on Friday 27th April and ending on the Sunday. A friend from Ireland, @realmikebutler, had told me about the conference so I got an early bird ticket as soon as they came up, without knowing any details.

The actual schedule, without talkers, wasn’t released until later and it looked like the conference was in fact only 1.5 days, talks Friday evening, Saturday and a BBQ on Sunday. I’d already booked my flights and hotel, arriving on the Thursday and coming back on the Monday, as I’d expected 3 full days of iOS talks. A couple of talks were later scheduled for the Friday afternoon, so I signed up for Josh Clark (@globalmoxie), TapWorthy talk.

So when the day arrived to head to Dublin I was heading off feeling pretty disappointed, but saw it as an opportunity to meet Mike again so all would not be lost.

I’m pleased to say that once the Friday talks started my disappointment vanished, Josh’s session was fantastic, really got you thinking about how to go about designing apps. Then the evening bash at the Sugar Club, was just inspired, the talk by Horace Dediu (@asymco) was informative and Aral Balkan (@aral) brought amazing humour to the evening, I’ll never forget the toilet videos.

We all agreed by the end of the first day that the conference was worth attending and we still had a day to go!

Conference Schedule

The main talks could not of been better, all of the speakers were enthusiastic about their subjects and gave everyone a lot to think about. A couple really stood out for me, Chris Harris (@_ChrisHarris) gave a demo of the app he created for the BBC, Wonders of the Universe. During a break he also showed me how he had created all of the graphical content using the iPad itself, using the power of the device to the max. The other talk was by Jim Dalrymple (@jdalrymple), writer of the blog The Loop, it was interesting to hear the app marketing nightmare from the other side of the fence.

There was also plenty of time to talk to fellow attendees, and as a freelancer this was as important as the talks themselves. You realise that you are part of a community, that there are others out there trying to do the same as you, with the same doubts and uncertainty, and that really does help. The BBQ on the Sunday just kept that feeling of community going, what a great idea.

I’m now ashamed of my initial disappointment, as the old saying goes “don’t judge a book by its cover”. The conference was one of the best I’ve ever attended both speakers and fellow attendees. The organisers, Paul Campbell (@paulca) and Dermot Daly (@dermdaly), did an amazing job and deserve a big THANK YOU.

I can’t wait for next years conference, I just hope they don’t sell out as quickly as WWDC

CCLabelBMFont – not displaying

I hit a problem today where the CCLabelBMFont wasn’t rendering the text I wanted at all. I created the the fnt file using http://www.n4te.com/hiero/hiero.jnlp

Turns out that as it creates the underlying png for some reason it saves it in a flipped format, therefore you need to load the png into your favourite graphics package and flip it vertically before using it in your project

See what I do

AirPrint – direct to the Printer

If you have an AirPrint enabled printer and an iPhone/iPad running iOS4.2 or above you can print directly to the printer without the need for both devices to be connected through the same WiFi access point. On your iOS device, go to your WiFi settings and in the list of networks you should see an entry that relates to the printer (so long as you are in range), and hey presto it all works

Localisation language names

When creating a new localisation file Xcode expects you to supply the correct name for the file, the list of valid values is here

CFBundleiconfile does not have an extension

Currently there is an issue with Apples Application Loader, although the documentation states that you can omit the file extension from the Icon File name, and this works when running locally, when you come to submit it to the app store it fails validation.

At the moment you have to specify the names using the CFBundleIconFiles
Screen shot 2010-07-28 at 16.09.49

This is also a useful link to the Apple site that explains what icons are need for what device

See what I do

Truly quit app under iOS4

Great article that explains how to terminate your app so that it doesn’t go into suspend mode, basic details are here

Multi-tasking can be great, but it has added some complexity to programming on the iPhone. For many apps there really is no advantage. For instance, does the “That’s What She Said” button really need to stay in memory?

It’s some added complexity that programmers don’t need.. some of the more complex memory intensive apps will just exit anyways, and programming the app to suspend can be a highly complicated task.

Fortunately there is a simple way to make your iOS 4 apps terminate for real when the user taps the home button.

This is a simple process:

Open your info.plist file
Add The Key UIApplicationExitsOnSuspend
Set the new key to YES
Now your applicationwillterminate: method will be run when the user taps the home key, and your app will exit for real.

See what I do

Previous Entries