changing the digital world one bit at a time...

Blants (noun) the rants of a blogger

  1. Writing to OS X ~/Library/Logs from your app

    June 18, 2011 by The Man

    In your main.m file just amend to look like the following.

    int main(int argc, char *argv[]) {
        id pool = [NSAutoreleasePool new];
    	NSString *logPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Logs/Depicus"];
    	freopen([logPath fileSystemRepresentation], "a", stderr);
    	[pool release];
        return NSApplicationMain(argc,  (const char **) argv);

  2. Android sales

    June 16, 2011 by The Man

    Just got past 100 sales. Not really selling like hot cakes but will crunch the numbers soon and see how it stacks up to iOS.


    Sales figures for 8th Feb to 17th June (129 days)

    Android sales – 101

    iOS sales – 689

    So that would suggest a 6.9:1 sales ratio.

  3. Scrolling credits on iOS – how to create.

    by The Man

    Ever wanted to have scrolling credits for your iOS device ? Here is how to do it…

    Scrolling Credits from Brian Slack on Vimeo.

    1. Take your existing photo and cut out a piece as high as your UIView and as wide as your text plus a little bit.
    2. This new image will be our mask.
    3. With the mask image cut out the centre so you have a rectangle top and bottom. Clone the layer and on the first layer delete the bottom rectangle, on the other layer delete the top rectangle
    4. Add a layer mask to both.
    5. With the layer mask selected add a black/white gradient (hold down the shift key to get a straight down gradient)
    6. Your mask image is now done, add to your XCode project with the main image then the text and then the mask image on top.
    7. To animate first reset the text so it’s always in the same starting position

    lblCredits.transform = CGAffineTransformMakeTranslation(0, 0);     
    CGRect frame = lblCredits.frame;
    frame.origin.y = 550.0;
    lblCredits.frame = frame;

    8. Then just animate up

    [UILabel beginAnimations:nil context:NULL];
    [UILabel setAnimationDuration:30.0f];
    [UILabel setAnimationCurve:UIViewAnimationCurveLinear];
    [UILabel setAnimationBeginsFromCurrentState:YES];
    [UILabel setAnimationDelegate:self];
    [UILabel setAnimationDidStopSelector:@selector(creditsHaveEnded)];
    CGAffineTransform transform = CGAffineTransformMakeTranslation(0, -1000);
    lblCredits.transform = transform;
    [UILabel commitAnimations];

    9. That’s about it, dependant on how you use it you may need to cancel the animation but I’m sure you can work that out 🙂

  4. OSX Trash stuck and how to fix

    May 31, 2011 by The Man

    If you have something stuck in the trash that will just not delete when you empty it then simply

    sudo rm -rf ~/.Trash/*

    and it should all be gone.