TOC | PREV | NEXT

Problem: NIBs don't get loaded
Solution:
During the conversion process, this BAD code is inserted:

       NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:[NSString stringWithFormat:
       @"%s.nib",[NSStringFromClass([self class]) cString]] ofType:@"nib"];

      If you look closely, you'll notice that it's looking for a nib named the same as the class, but with two .nib endings!
      The correct incantation is:
      
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:NSStringFromClass([self class]) ofType:@"nib"];


Problem:
Program crashes encoding two objects in an on-the-fly array:
      Bad code:
      [archiver encodeRootObject:
            [NSArray arrayWithObjects:array1,array2]];

Solution:
Remember to terminate all on the fly lists with "nil" - this applies to dictionaries, arrays, and other variable argument list methods:

      Good code:
            [archiver encodeRootObject:
                  [NSArray arrayWithObjects:array1,array2,nil]];


TOC | PREV | NEXT
Match: Format:
Search:
Created by Stone Design's Create on 6/2/1997