Archive for November, 2010

November 23, 2010
Author: olifarago

For an app we were developing I found myself needing to know the model and the disk capacity of the device the app was running on.

I found plenty of resource for identifying the device. The two methods appear to revolve around either testing the device for feature combinations known to appear on certain devices or using the sysctlbyname function in the standard C library. For various reasons I opted for the latter more information on which can be found on this site:

Next was trying to find the capacity.  I could find very little information on this but eventually settled on this which worked well for me.

NSDictionary *fsAttr = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil];
float diskSize = [[fsAttr objectForKey:NSFileSystemSize] doubleValue] / 1000000000;
NSLog(@"Disk Size: %0.0f",diskSize);
November 18, 2010
Author: olifarago

This is the much overdue followup to Part 1 which can be found here:

We had subclassed UITabBarController and hidden the existing buttons.  Now all we need to do is replace then and create the functionality.

To download a demo project demoing the below click here:

3. Add My Own Items

Now we are going to create our new buttons. You need to create your four buttons in both a selected and unselected state and add them to your project. Assuming a portrait orientation you are looking at 320px wide in total and 50px high. I am going to assume that our new buttons are 80px X 50px each.

So, back to XCode. more

Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin