Pixelchild

Feb 20

objective-c singleton macro that supports both ARC enabled and disabled projects

Im a big fan of Matt Gallagher’s singleton macro and have been useing a slightly modified version of it by Oliver Jones.

Lately however I’ve been enabling ARC in my projects and came across the problem of including the macro only to have xcode winge to me about all the release methods. Im using a library so I wanted my macro to support both enviroments. I initially went back to Matt’s macro to see if he perhaps updated for this situation but it seems not so. I was also suprised to see that i couldnt really find any thing else usefull on the subject.

Read More

Nov 30

How to create a Tweet Sheet the correct way in iOS 5

With the many new features introduced in iOS 5 I was particularly excited about the new Twitter.framework. Apple customers can now enjoy the pleasures of having their Twitter accounts baked right into the OS granting access to the twitter-verse from every nook and cranny in the device. While developers can now integrate twitter into their apps much faster and more easily than it has ever been before.

Read More

Nov 14

How to convert a html hex string into UIColor with objective-c

Typically you should be using RGB (Red, Green, Blue) UIColor’s. However, every now and then you will need to create one from a HEX string. Probably from an API you have to deal with. None the less there is an ubundance of different methods you can use converting hex strings into UIColor objects. This is the solution I swear by and never had a problem with it thus far.

Read More

Oct 17

How to fix “this class is not key value coding-compliant for the key”

If you ever come across this error:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ...'

It is likely you have either renamed an IBOutlet property or removed a nib (.xib) file associated with your class.

If you removed the nib and decided to go nibless you can fix this error by simply selecting “Reset Content and Settings” from the ios simulator menu or “delete” the app from your device. You may also have to perform a “Clean” in xcode (Product > Clean).

Otherwise, If you still have your nib and renamed an IBOutlet property then simply open the nib file and reconnect your IBOutlet with its corresponding UI control. You may also need to disconnect the old one. It should appear grayed out.

Sep 26

Repair -weak_library /usr/lib/libSystem.B.dylib for Urban Airship

This week I was implementing Urban Airship into my application when i came across this weird behaviour. I followed the documentation and implemented all the steps only to find the application would crash with “EXEC_BAD_ACCESS” before if even finished loading. A little confused I tried to NSZombie the root of the cause however instruments wouldn’t attach to the target and I had to force quite instruments just to regain control of my computer.

Read More

Sep 20

New Badass Features in Visual Studio 11 for Front End Developers

Microsoft Visual Studio is my primary weapon of choice for web development and the new set of features coming in the next edition can only be explained as badass!

The first thing you’re going to notice is you can now single click (highlight) files from the solution explorer to open them. Quickly traverse files with the up and down arrow keys and watch the contents of each file flash in front of you as go. I’m actually surprised at how quick they seem to load. This is fantastic as I’ve always hated how you had to double click files and end up with a massive amount of tabs. If you’ve ever used xcode before, this now works in the exact same way.

Read More

Sep 19

How to recursively copy files using MSBuild Copy Task

Today I was faced with the problem of copying a set of files into a new location using a MSBuild task. Previously we got the job done using an xcopy command post build, while this was okay it’s not ideal for front end developers. 

The problem is front end developers are constantly tweaking files usually followed by refreshing the website over and over. In my case today we where building from a kernal, so the task of building the dll’s and waiting for iis to recompile is all very time consuming.

Read More

Tips for making jQuery selectors faster

Unfortunately jQuery selectors aren’t stupid proof. Its all too easy to chuck a long string of junk into your selector and not have a single problem. You might have the attitude of, “meh it works” and not give it any more thought of if there is a better way.

The upside of actually paying attention to your jQuery selectors is: the faster they execute the faster your page is going to render and operate. This is especially true for browsers with slower javascript engines like Internet Explorer and phones/devices with lower memory.

I hope that you find using my following tips your jQuery selectors will become optimised to the fastest execution time humanly possible.

Read More

Sep 17

A hitch hikers guide on how to improve jQuery performance

I see all to often the simple mistakes developers make when coding with jQuery.

Hopefully these tips will appear simple to you and thats because they ARE. These basic changes to your coding habits will have drastic performance improvements to your jQuery.

Read More