Posts Tagged ‘iOS’

Reading List :: Wednesday 19th October 2011

I’m in the middle of a big (final, major) software project at the moment which has prevented me from posting any longer bits to the site in a few weeks. This project isn’t going anywhere – as in, I’m definitely going to be working on it for the next few months…it’s progressing, but it’s also big – so in order to keep the site ticking over I’m going to start a semi-regular ‘Reading List’. If there’s anything insanely great that pops up in my morning reading session – guitars, code, consumer electronics, whatever – it’ll get featured on the list. Simple!

This morning has been pretty much dominated by coverage of the joint Google/Samsung press conference which, having been held in Hong Kong, took place at strange o’clock in Europe and the US. Oh, and Motorola (Google?!?) also had an event and announced the coolest Android phone in the world for all of about, oh, half an hour. Rather than any of the ‘news’, which in Android-land is ridiculously ephemeral and kind of difficult to get excited about most of the time, the most interesting article I found was Joshua Topolsky’s interview with Matias Duarte, the Danger/webOS UI designer who has been tasked with classing up Android and who’s first wide release of the OS (I’m not counting Honeycomb) will be the stupidly named but intriguing Ice Cream Sandwich. I full on dig this guy’s attention to detail, and his shots at the faux-wood/leather/etc are so, so justified – even Gruber said so. Google should give him carte blanche; he’s totally got what they’ve been missing.

I’ll be downloading the Android 4.0 SDK for a play at some stage – I’m an iOS developer, but like so many I learned the ropes on Java…so the only thing stopping me from writing for Android is the godawful SDK. And Eclipse. Hopefully this one will bring parity with Xcode, but I’m not holding my breath.

This is actually from yesterday, but is very creative, very cool and very creepy indeed. Nothing we didn’t know already (what, Facebook has loads of my data? Whoa!), but man, what a visceral way to present it. Just remember to delete it from your applications after use.

Lastly, Forbes’ profile of Dropbox. I love Dropbox, but interesting that Jobs told them he’d crush them with iCloud – I’ve already got it synching my MacBook Pro and iMac, and will add my iPhone 4S when it arrives later. iCloud has already obviated two of my regular cross-machine sync solutions, might Dropbox be next?

Solving the MBProgressHud _WebTryThreadLock Error

MBProgressHud is a really nice bit of plug in code to add fancy status and loading notifications to your iOS app quickly and easily. It looks great! Unfortunately, there’s an irritating error which cost me some time this morning, and hopefully I can save anyone else in the same position some trouble.

The error:

bool _WebTryThreadLock(bool), 0x7b9b5500: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...

This appears when a method which needs to update a UI component is called directly by the MBProgressHUD object.

The most basic usage of MBProgressHUD is thus:

HUD = [[MBProgressHUD alloc] initWithView:self.view];
[self.view addSubview:HUD];
HUD.delegate = self;
[HUD showWhileExecuting:@selector(fetchNewData) onTarget:self withObject:nil animated:YES];

In which ‘fetchNewData’ is the method which is executed while the progress HUD is on display.

Using this technique, fetchNewData will be called on a secondary thread, which causes the crash error we’ve already experienced. UIKit, which handles all the user interface business, should only be running on the main thread, so when the secondary thread makes a move on a particular UI element, its going to throw the ‘web lock from a thread…’ error. (It should be noticed that you can update some UI components using the standard MBProgressHUD setup detailed above, but in most cases you’ll get the error.)

In the case of this example, ‘fetchNewData’ updates part of the UI, so it needs to be called on the main thread. The quick and dirty workaround I used to force it to execute where I wanted it to was to create an intermediary method which can be called by MBProgressHUD as normal but in turn calls ‘fetchNewData’ specifically on the main thread.

You could, for example, call this method ‘performFetchOnMainThread’:

-(void) performFetchOnMainThread    {
[self performSelectorOnMainThread:@selector(fetchNewData) withObject:nil waitUntilDone:YES];
}

Instead of directly calling ‘fetchNewData’ from MBProgressHUD, use it to execute ‘performFetchOnMainThread’, which uses the ‘performSelectorOnMainThread’ method to force ‘fetchNewData’ to be executed on the main thread.

This isn’t the most efficient or beautiful way to accomplish this, but it works, so if you’re getting a ‘web lock from a thread…’ error and you need to make sure your code is executed on the main thread, you can use this technique to get the job done quickly.

Colorshare – Available in the App Store

Hot off the presses and approved by Apple mere moments ago, colorshare will become available in regional iPhone App Stores the world over over the next 48 hours or so.

Colorshare is a simple utility which allows you to quickly design a palette of colours on your iPhone or iPod Touch and with the tap of a button share it with the web using the unique palette ID number, which you can punch right into the colorshareapp.com homepage.

Once you’ve entered the ID of the palette you want to work with, it will appear on screen alone with a full breakdown of each colour in RGB, hexadecimal and CMYK.

Colorshare is completely free, and you can grab it from the App Store by following this link.

WikiKnowItAll – In the App Store

Brand new to the iOS App Store, WikiKnowItAll lets puts your own personal wiseacre right in your pocket. We all know someone who knows something about everything, and with Wikipedia behind them your WikiKnowItAll will never run out of interesting factoids – or enthusiasm for letting you know. The app is available in the iOS App Store today.

 

 

 

iPhone App Preview – colorshare

Coming soon to the web and the iPhone, a very quick and very easy way to prototype color schemes and share them online. ‘colorshare’ is currently in testing, but it should soon be available on the iOS App Store as a free download.

Meanwhile, the future home of the application on the web is online already, with features (beyond a placeholder) coming soon.

Growl Extensions

Growl is a vital addition to OS X for any power user. Unobtrusive notifications may be new to iOS, but for many years Mac OS users have enjoyed informative yet subtle messaging in the corners of their desktop through this program.

What many people might not realise, however, is that Growl actually ships with a couple of great plugins which enhance its usefulness yet further.

(more…)

Make Your Own MacBook eReader / Tablet

…also known as the DIY-iPad.

I don’t know if it’s the frustration of having to read hundreds of pages on my laptop or my burning desire to enhance the lives of others which drives me to create innovations like this. Sometimes you’re just blessed with a life changing idea. Instructions below.

Introducing the MacBook Pro eReader:

(more…)

Massively Useful iOS App: PlainText

Great iOS apps are often the ones which make you wonder what you ever did without them: I like apps which perform simple operations super effectively, and PlainText from Hog Bay software (homepage) is just such a program.

The premise is simple: a notetaker / plain text editor for your iPhone or iPad which links to your Dropbox account and syncs to a folder of your choice. PlainText combines this idea with a great looking UI and simple operation. And because it uses Dropbox, you can write a shopping list on your computer and it’ll be on your phone when you get to the store, or take notes in a lecture without having to bring your laptop and review them on your main computer when you return home.

PlainText is ad supported and free in the App Store. In fact, my only complaint is that there isn’t the option for a $1 ad-free ‘pro’ version. But aside from the fact that your only option is to get it for free (harsh criticism indeed), PlainText performs its duties pretty much perfectly. This thing is dead useful – if you own an iOS device and are a Dropbox user, you straight up need to grab this app. Just let me pay a little for it!

App Store link