Flipkart Search

Search This Blog

Saturday, April 17, 2010

Difference b/w NSArray and NSMutableArray

NSMutableArray (and all other classes with Mutable
in the name) can be modified. So, if you create a plain NSArray,
you cannot change its contents later (without recreating it). But if
you create an NSMutableArray, you can change it.

Friday, April 16, 2010

Difference between signed and unsigend data types

Signed Data Type - a signed data type is one that can hold both positive or negative values, i.e. -1 or +456. A 32 bit signed integer can hold the range -2147483648 to 2147483647

Unsigned Data Type - Unsigned data types can only hold positive values.
An unsigned 32 bit integer for instance can hold the range 0 to 4294967296

Tuesday, April 13, 2010

The most annoying Xcode error ever: The Info.plist for application at (null) specifies a CFBundleExecutable of (null), which does not exist.

If you're developing an iPhone application in XCode and getting the
error:
“The Info.plist for application at (null)
specifies a CFBundleExecutable of (null), which does not exist.”
here's
how to fix it:

In Xcode, choose "Executables" from the project
hierarchy. Click your project executable then press Command-I. Choose
the General tab and set the working directory to "Build Products
directory".

This fixed the problem. The advisory from Apple did
not help much, but did mention the Build Products directory. Under SDK
release notes for iPhone OS 3.1, XCode/Developer Tools
:

"Changing
an iPhone Executable's working directory from “Build Products
directory” may cause the application not to install properly with the
error message “The Info.plist for application at (null) specifies a
CFBundleExecutable of (null), which does not exist.”"
Hope
this saves you a little time. It frustrated me for a while.

Thursday, April 8, 2010

Get list of all available fonts with family names in iPhone

Here is the piece of code to get list of all available fonts in your iPhone. This will print the list in gdb          


NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
            NSArray *fontNames;
            NSInteger indFamily, indFont;
   
            for (indFamily=0; indFamily<[familyNames count]; ++indFamily){
               
                NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
               
                fontNames = [[NSArray alloc] initWithArray:
                             [UIFont fontNamesForFamilyName:
                              [familyNames objectAtIndex:indFamily]]];
                for (indFont=0; indFont<[fontNames count]; ++indFont){
                   
                    NSLog(@"Font name: %@", [fontNames objectAtIndex:indFont]);
                }
               
                [fontNames release];
            }
   
            [familyNames release];