« July 2007 | Main | November 2007 »

October 2007 Archives

October 15, 2007

A modern API for Cocoa

It's kinda obvious: the API is so oldfashioned, it's really starting to become embarassing to use the various arcane namings. Today I made the decision, that I will start adding some convenience methods to my classes, that hide the ugliness.

Here's the first one, that also conveniently does away with the BOOL parameter. Who ever said NO to setNeedsDisplay: anyway ?

Probably more to come as things develop...

@interface NSView (MulleModernAPI)

- (void) iCanHazDisplay
{
   [self setNeedsDisplay:YES];
}

@end

October 29, 2007

NSInteger ? Why not just int ?

Being old enough to have witnessed the migration from 16 bit int to bit int, I assumed that eventually int would become 64 bit. With this NSInteger thingy, it's been a big surprise. Because if int had just naturally grown to 64 bit, we wouldn't need this NSInteger at all.

I think somewhere in the C-Standard it even says, that int can be expected to be the "natural" fit for the CPU.

That the Cocoa APIs were designed using int and unsigned int for years instead of using size_t or some such like the rest of the world, to me only ever made sense, if indeed int was basically used as the migration type. That's one of the main features of C to define types not strictly as having a certain size, expressly intended for upwards migration... to belabor that point.

If I were to change all by ints to NSInteger using that tops script, I'd have the identical runtime problems as if the compiler had changed the meaning from 32 bit to 64 bit.

So where's the benefit ?

October 30, 2007

iPhone + T Mobile = The Number of the Beast

Insgesamt: 24 Monate * €49 + Bereitstellungspreis €25 + iPhone €399 = €1600
Monatlich: €1600 / 24 Monate = €66.6 !

About October 2007

This page contains all entries posted to Nat!'s Web Journal in October 2007. They are listed from oldest to newest.

July 2007 is the previous archive.

November 2007 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34