TOC | PREV | NEXT

Problem: Unix functions are not portable
Solution:
Use NSFileManager
OLD:
- updateDirectoryTime:(char *)dir
{
      struct timeval tvp[2];
      time_t currentTime;
      currentTime = time(NULL);
      tvp[0].tv_sec = tvp[1].tv_sec = currentTime;
      tvp[0].tv_usec = tvp[1].tv_usec = 0;
      if (utimes(dir,tvp) != 0)
            NSLog(@"utimes: couldn't update %s's last modified time: %s\n",
            dir, [[NSApp unixError:errno] cString]);
      return self;
}

NEW:
- updateDirectoryTime:(NSString *)dir
{
      [[NSFileManager defaultManager] changeFileAttributes:
       [NSDictionary dictionaryWithObjectsAndKeys:
             [NSDate date],NSFileModificationDate] atPath:dir];
      return self;
}

Problem: When loading a nib, you get "Image not found" message:

Nov 8 17:08:34 Create[7927] Could not find image named `shapes'.

Solution: Apparently IB (PR1) leaves in old, unused images by name, but they do not exist in the project. One cheesy way that works is to open the .nib wrapper in Edit, and then open the "objects.nib" file. Look for the name of the image, and CAREFULLY, fill in its place another image name of the same length of characters of an image that DOES exist in your project...
      For example if you can replace the "shapes" with "corner" if you have a "corner" tiff in the project:
      
      NSCustomResource)ÔÖÃÚÚNSImageÅÃÚÚshapesÅÅÄÄÅÒÃܵÇ$
      
      NSCustomResource)ÔÖÃÚÚNSImageÅÃÚÚcornerÅÅÄÄÅÒÃܵÇ$

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