UITableView Pull to Refresh

I know, i know. Apple’s iOS 6 introduces a new component (which is already available in the sdk)… that allows you to refresh a table whenever the user pulls it.

However… not everyone is targetting iOS 6 +… at least not yet. So, i’d like to share a link with you. Sam Vermette, a fellow with a couple public github repositories, did an excellent job writing an UIScrollView extension. It’s super easy to setup… clean, and most of all, self contained.

It’s called, simply, SVPullToRefresh. So… Thank you Sam!

 

Unlock Hidden Wallpapers in MountainLion

Long time no see!. It must been a month, at least, since my last post. I’ve come across this article… and thought it would be a good idea to store this somewhere, so i don’t loose track.

It’s simple. Just open this folder:

[code]/System/Library/Frameworks/ScreenSaver.Framework/Versions/A/Resources/Default Collections/[/code]

You’ll find about 147 MB of high definition wallpapers, that are already bundled in your Mac, and nobody told you. They’re retina-sized (3200×3000), so if you’re using a Macbook Pro with Retina Display.. it will definitely look awesome.

Mac Hidden Wallpapers

Resetting the Push Notifications Permissions Alert on iOS

I’m just pasting this from Apple’s Technical note… it’s soooo useful, yet, everytime i need to debug this, i spend at least 15 minutes with google…!.

The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day.
If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by setting the system clock forward a day or more, turning the device off completely, then turning the device back on.

Fixing ‘Text in UITextField moves up after editing’ glitch

I’ve recently come across this glitch in iOS: Text in UITextField moves up after editing (center while editing).

Long short story… when you end editing a textField, if you’re using a custom font, the text might move up. (If you get this glitch). Well, it turns out that this is a font specific problem… it’s not in your code.

So… how will we solve it?. TTX!. In this previous post we explained how to make TTX work in your 64 bit mac. So we’ll begin from there.

[cc lang=”bash”]
Decompile your font. (ttx font.otx will do the trick).
Find the section
Find the attribute, and set it to 0.
Recompile your font. (ttx font.ttx should work).
[/cc]

Try it. If that doesn’t work, you can try changing the ‘ascent’ attribute to 940, and ‘descent’ attribute to -260, which are the values that MuseoFont has.

That worked for me…!

resignFirstResponder, the easy way!

If you have an UIControl in edit mode… but you have no idea which one is it… and you need to resignFirstResponder, there is an easy way to do this. No, you don’t need to hook to notifications. And you don’t need to find the firstResponder. This can be solved with just one call.

What you need to do is…

[cc lang=”objc”][_tableView endEditing:YES][/cc]

Note that you could have anything else rather than a _tableView.
Easy. Right?

%d