Objective-C String Format Specifiers (for use in NSLog)

This is link to a list of string format specifiers which can be used in a call to the NSLog function which is useful when debugging iOS code.

Perhaps the most useful to know by heart are:

  • %i for integers (often used to debug loop counters and array offsets)
  • %f for floats.
  • %@ for any Objective-C object – including NSString objects

Examples:

NSLog(@"Calling function foo");

NSLog(@”Value of integer: %i, Value of float: %f”, myInteger, myFloat);

NSLog(@”Value of NSString variable: %@, Value of NSDate: %@”, myString, myDate);

NB: The %@ string format specifier actually calls the object’s “description” method. Many of Apple’s classes include an implementation of description that provides extra info for debugging. You can also implement this method in your own objects for the same purpose.

IMPORTANT: As well as writing to the Debug console, NSLog also writes to a file on disk. Obviously, this will have a performance impact. Make sure you remove (or comment out) all calls to NSLog in the released version of your app or you may refer to yourself as a pillock at a future time.

Local vs Global Resource Files in ASP.NET

One question developer’s eventually ask themselves when localizing APS.NET web apps using resource files is why the hell would anyone use local resource files when the advantages and simplicity of using global resource files seems so obvious?

The closest I have got to any definitive guidelines from Microsoft is this passage from the “ASP.NET Web Page Resources Overview” on MSDN

Choosing Between Global and Local Resource Files

You can use any combination of global and local resource files in the Web application. Generally, you add resources to a global resource file when you want to share the resources between pages. Resources in global resource files are also strongly typed for when you want to access the files programmatically.

However, global resource files can become large, if you store all localized resources in them. Global resource files can also be more difficult to manage, if more than one developer is working on different pages but in a single resource file.

Local resource files make it easier to manage resources for a single ASP.NET Web page. But you cannot share resources between pages. Additionally, you might create lots of local resource files, if you have many pages that must be localized into many languages. If sites are large with many folders and languages, local resources can quickly expand the number of assemblies in the application domain.

When you make a change to a default resource file, either local or global, ASP.NET recompiles the resources and restarts the ASP.NET application. This can affect the overall performance of your site. If you add satellite resource files, it does not cause a recompilation of resources, but the ASP.NET application will restart.

iOS Custom Icon and Image Creation Guidelines

Guidelines from the “iOS Human Interface Guidlines” manual for creating all the required, custom App icons and images. All sizes and formats are covered in this section.

Disabling the icon shine effect

Select “MyAppName-info.plist” In the “Supporting Files” folder. Expand the keys Icon files (iOS 5) / Primary Icon and set “icon already includes gloss effect” to YES