Getting the path

Discussion in 'Mac Programming' started by Binju, Apr 4, 2010.

  1. Binju macrumors member

    Joined:
    Jan 31, 2010
    #1
    I have a Resorces -> Media -> Player.playlist .

    Code:
    NSBundle *thisBundle = [NSBundle bundleForClass:[self class]];
    	 NSString *filePath = [thisBundle  pathForResource:@"Video1" ofType:@"mov" inDirectory:@"Media/Player.playlist"];
    													
    	NSLog(@"File Path=%@",filePath);

    File Path always display nil.
     
  2. Sydde macrumors 68020

    Sydde

    Joined:
    Aug 17, 2009
    #2
    Does it work when you use [NSBundle mainBundle] ?
     
  3. Binju thread starter macrumors member

    Joined:
    Jan 31, 2010
    #3

    It works when i use te below code,


    Code:
     NSString *movieName = [NSString stringWithFormat:@"video%d", i];	 movieFile = [thisBundle pathForResource:movieName ofType:@"mov" ];
    The problem arise when i use inDirectortory:
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Can you post the path, relative to your .app, that you are trying to load the movie from? That way we can, perhaps, help you work out the usage required.
     

Share This Page