robertjpayne
robertjpayne
Robert Payne
10 posts
Don't wanna be here? Send us removal request.
robertjpayne 12 years ago
Photo
Tumblr media
1 note View note
robertjpayne 14 years ago
Link
understatementblog:
The announcement that Nexus One users won鈥檛 be getting upgraded to Android 4.0 Ice Cream Sandwich led some to justifiably question Google鈥檚 support of their devices. I look at it a little differently: Nexus One owners are lucky. I鈥檝e been researching the history of OS updates on Android phones...
4K notes View notes
robertjpayne 14 years ago
Text
Archiving, Unarchiving, and Copying NSManagedObject's
Core Data is awesome. So awesome I use it in just about every single Cocoa application I write for either Mac OS X or iOS. What makes Core Data so great is that it normally just works. By normally I mean 80% of the time. The other 19% of the time there is a not-so-easy but still simple workaround but still a workaround that doesn't take long to implement.
Then theres the 1% of cases where Core Data is so frustrating it nearly makes probably others and myself want to either run off a cliff, walk in front of a giant truck, rob an Apple store or commit suicide in any other way possible.
The 1% for me normally comes down to two scenarios. Copying NSManagedObject's and putting them on the clipboard for copy/cut/paste sweetness.
If you're in the same boat I have a treat for you today. 6 hours, 2 beers, a little research, a lot of documentation and a bit of programming and testing I created two classes and a category. NSManagedObjectArchiver, NSManagedObjectUnarchiver and a NSManagedObjectCopying category.
These three classes do exactly what you think. They archive managed objects to NSData, unarchive them from NSData and allow you to copy them. They not only work on NSManagedObject's attributes they also support relationships fully ( including circular ones! ) so you can take a single object archive it and restore it later. They're also smart though and only archive the object's once even if it's in multiple places in the object graph.
I should note these classes are not "extremely" tested and thus may have some quirks.
View Gist @ github
Enjoy, -Robert
20 notes View notes
robertjpayne 14 years ago
Text
Using Uncrustify directly in Xcode 4!
One of the biggest problems I have using 3rd party libraries is that they're formatted horribly and there's not many great code formatters around that can do Objective-C, C, C++ all in one go. Luckily Uncrustify can but it's not exactly the easiest to configure or get running easily. With the help of a small ruby script and a little time exploring the preferences in Xcode you can set up Uncrustify to scan your project's directory for all .h, .m, .c, .mm files and format them at the whim of your keyboard. You'll need two files stored somewhere on your drive. I put them in /usr/local/etc/.
Shell Script:
Uncrustify Config:
Xcode Behavior:
With both of these stored on your hard drive it's as easy as going into Xcode's preferences and adding a behaviour on the behaviour tab. Here's what mine looks like:
Tumblr media
聽 Remember to customise the uncrstufiy config as you see fit!
聽 -Robert
6 notes View notes
robertjpayne 14 years ago
Text
Changing Xcode 4's default code snippets
Xcode 4 brought along a code snippets feature that is actually useful. Nearly as useful as TextMate snippets but not quite as powerful. One of the most annoying things though is that Xcode bundles in a bunch of default snippets that you can neither edit nor remove in Xcode. With a little snooping around it's pretty easy to find how to update these or get rid of them so you can have your code looking the way you like again. Is what you're looking for. It's a .plist and pretty straight forward. I tend to back up the System one and symlink my own from a Dropbox directory for all my replacements. Note you shouldn't remove this file though just empty it out if you're looking to get rid of all the snippets. -Robert
4 notes View notes
robertjpayne 14 years ago
Text
Installing oursql via pip on Mac OS X
Even easier than ever using pip: Enjoy, Robert
1 note View note
robertjpayne 14 years ago
Text
Xcode 4: How to bring back documentation table of contents!
This snippet finds a boolean flag that is set telling the documentation to hide stuff in Xcode 4 only and replaces it to make the documentation think it鈥檚 running in Xcode 3.
It does have a caveat the documentation loads a bit wonky and refreshing whenever you click anything unlike Xcode 3 did. I still find it saves me loads of time.
-Robert
0 notes
robertjpayne 14 years ago
Text
Xcode 4: How to add a delay to auto completion
Xcode 4 brings amazing auto completion at your fingertips with the new source editors. For some weird reason, however, they removed the option to delay when it shows up. I tend to type extremely fast at times and having the auto complete constantly trying to suggest stuff can get in the way.
Want to turn it back on? Just run the command below in terminal: Change the delay to you're liking I find 0.1 to be the perfect balance.
-Robert
3 notes View notes
robertjpayne 15 years ago
Text
Working @ Cactuslab in Auckland New Zealand
This week I started on a new adventure one that involves a rather unreal Cactus in a lab that I'd probably call more of a office than anything else. Jokes aside I started as a full time Senior iOS Developer at Cactuslab in New Zealand. I'm working with a small but incredibly talented team of people creating some pretty neat content for the web and more recently iOS enabled devices.
As such I hope to blog a bit more about certain aspects of iOS and Objective-C as I start to use it on a more regular basis.
-Robert
0 notes
robertjpayne 15 years ago
Text
New Site & Blog Included
Finally decided to get my own blog. I write quite a bit of content related to Zwopple and Zwoptex on the Zwopple company blog but I always felt that it wasn't a good idea to start to include more personal or unrelated content on that blog.
Originally I wanted this site powered by python and a django flavored blogging system but after a couple of days of struggling and little luck I decided it was best to settle down with wordpress. It isn't bad in any way I was just looking to eliminate php off my web servers completely to reduce memory usage.
Anyways, expect to see some more engaging content in the future related to all sorts of development I do.
Cheers, -Robert
0 notes