Pages

Mountain Lion og NemID (Danish)

Hvis du som mig ikke kunne bruge NemID (Netbank login m.fl.) efter opgradering til Mountain Lion, så fortvivl ej længere.

Åbn Terminalen og skriv: java

Tryk derefter på Enter og du vil nu få Java installeret på din Mac igen og du kan efter browser genstart igen bruge din netbank m.v.

UIStepper rookie mistake

I’ve been working on an upcoming fitness app primarily for myself and my training buddy.

One important feature we need is to change the weight during a workout, so the choice fell on the UIStepper.

Stupid as I were, I did the following:

stepper.value = self.exercise.weightValue;
stepper.maximumValue = 500000.0;
stepper.minimumValue = 0.0;
stepper.stepValue = 250.0;

This resulted in that the value would always be 250 or 750 after a press on either – or +.

The mistake is stupid, when setting the value the maximumValue is defaulted to 500 and therefore automatically caps the value to 500 as  well.

Solution

stepper.maximumValue = 500000.0;
stepper.minimumValue = 0.0;
stepper.stepValue = 250.0;
stepper.value = self.exercise.weightValue;

That was all :)

Handling incoming JSON redux-modified

At work I finally got on a project where we had control over the server and JSON was naturally chosen as the desired output format. This meant I could finally make use of the category to safely set properties on any NSObject descendant from a NSDictionary written by Tom Harrington published in the article Handling incoming JSON redux.

But I ran into a limit with the category, it would only set properties defined in the class itself and not properties defined in a possible super class.

Long story short, I modified the category to support single inheritance in this gist, feel free to use and/or fork.

P.s. Need to modify this theme to support code preview.

Dropbox.com and Google AdWrods

My friend @MarkusKrogh retweeted this from @SteveStreza

Just maxed out my Dropbox referrals by posting my referral link on Google’s AdWords. 16 GB of free space. Total one-time cost: $6.17.

So I though why not and have given it a shot and so far two have signed up. I’ll post detailed information later on.

Update 1:

After less than 24 hours my current status on dropbox is this:

So far you’ve earned 17 GB of the 32 GB maximum bonus space possible from referrals

But it seems that I may have set the price pr. click too high, so far I’ve spent ~$20 and therefore I’ve halved the price pr. click.

Next update in approximate 24 hours.

Update 2

Woke up to a swarm of Dropbox referral mails and my account status is now:

So far you’ve earned 32 GB of the 32 GB maximum bonus space possible from referrals.

Acoording to my AdWords account my total spending is only $22. In retrospective I should have started out low and maybe I could have matched the spending of @SteveStreza.

Anyway $22 is almost 1/5 of the annually price of Pro 50 and this is a one time fee for me :)

I’ll publish my AdWords report  during this weekend if I find the time.