iPhone 5 with an in-house Maps App?

I’ve been reading all over the net an interesting roumor. The next iPhone, AKA ‘iPhone 5’, may be released with a new iteration of our beloved OS… iOS 6. But… what goodie could it introduce?.

Well… the biggest idea around, and i’m posting it because i think there is a big chance it’s actually accurate, would be an in-house Maps app. Why i think this?. Because the current Maps App relies heavily on Google. In fact, it wouldn’t do anything useful if it wasn’t for Google.

And as everybody knows, Google and Apple are on trial for Android. So… if i were them, i’d try to take some distance. To begin with, i’d cut the Google Maps app… it’s the obvious move. Let’s see what happens in October!

Thundercats 2011

This has very little to do with iOS. But i love it anyways.. so here we go!. When i was … less than 4 years old, i was a big fan of the Thundercats. Back then, i had a copy of the Sword of Omens. Never managed to get a glimpse of the real one… wherever it is!.

Last year, Cartoon Network fellows published a reboot of the Thundercats. It’s called ‘Thundercats 2011’. So far, i just love it. The story is a bit different… either way, this re-imagined version is pretty cool.

No. I’m not an anime dude. Furthermore, i don’t usually watch cartoons. But this one is different, because it remind me of the oooooold school toons i used to watch.

Fixing Bootstrap Errors

I’ve been having this error… A LOT…:

“Couldn’t register com.yourcompany.yourapp with the bootstrap server. Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger.”

The bad side of this is that.. ps aux will not show anything useful. Thankfully, Mike Ash has solved this… i’m pasting below his script:

launchctl list|grep UIKitApplication|awk '{print $3}'|xargs launchctl remove

Source: Mike Ash Blog

Removing subviews that match any given criteria!

So… suppose that you have a container view. And for some reason, you need to remove the subviews that match any given criteria.

The straightforward solution would be to write a foreach loop, by hand, and remove the target subviews with a method call. Guess what!. There is a kung fu solution to this..!!. Check this out:

NSPredicate* predicate      = [NSPredicate predicateWithFormat:@"self isKindOfClass: %@", [SomeView class]];
NSArray* viewsToRemove = [[self subviews] filteredArrayUsingPredicate:predicate];
[viewsToRemove makeObjectsPerformSelector:@selector(removeFromSuperview)];

Less code is better. Always.

Detecting taps in any UIView subclass

This one is a quick and easy trick. How do you detect taps in any UIView?.
Simple. You need to use the UITapGestureRecognizer class… this way:

// Alloc the gesture recognizer
UITapGestureRecognizer* tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapped)];
[tapGestureRecognizer setNumberOfTapsRequired:1];
[anyRandomView addGestureRecognizer:tapGestureRecognizer];
[anyRandomView setUserInteractionEnabled:YES];

[tapGestureRecognizer release];
tapGestureRecognizer = nil;