bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBundle: method not implemented.


From: Chris Vetter
Subject: Re: NSBundle: method not implemented.
Date: Mon, 11 Sep 2006 12:53:28 +0200

On 2006-09-10 23:30:09 +0200 Christophe JALADY <christophe.jalady@free.fr> wrote:
The method
pathForResource: ofType: inDirectory: forLocalization:
is not implemented in the class NSBundle. (In gnustep-base 1.13.0).
If somemone have the skills, the time and want to implement it for the next release ... I will be really, really grateful for that !!!

Untested but should work as expected.

- (NSString*) pathForResource: (NSString*)name
                       ofType: (NSString*)ext
                  inDirectory: (NSString*)subPath
              forLocalization: (NSString*)localizationName
{
  NSArray       *array = nil;
  NSEnumerator  *enumerator = nil;
  NSString      *path = nil,
                *result = nil;

  array = [self pathsForResourcesOfType: ext
                            inDirectory: subPath
                        forLocalization: localizationName];

  if( array )
  {
    enumerator = [array objectEnumerator];
    while( (path = [enumerator nextObject]) )
    {
      if( [path rangeOfString: name] )
      {
        result = path;
      }
    }
  }

  return result;
}

--
Chris





reply via email to

[Prev in Thread] Current Thread [Next in Thread]