• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSBundle getting location of file in bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBundle getting location of file in bundle


  • Subject: Re: NSBundle getting location of file in bundle
  • From: Michael Vannorsdel <email@hidden>
  • Date: Thu, 5 Jun 2008 20:50:35 -0600

Try using NSURL's fileURLWithPath:, you won't need to preappend "file://".


On Jun 5, 2008, at 8:37 PM, Mark Bateman wrote:

I'm currently hardcoding the file location just for debugging my app. It works great.

I'm now trying to use NSBundle to insert the resource location string for a webview. I'm using locally stored content inside the app bundle. I tried using:

NSMutableString *url;
url = [NSBundle pathForResource: @"AirportInfoPDA"];

I can't tell if this returns the full path including the filename & extension as the program now crashes.

the full path i've been using on the simulator is

file:////Users/mark/Documents/Projects/FltPlan/PDA/AirportInfoPDA.htm

works well with:

[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: url]]];

How do I form the correct path from the bundle location and use the AppendString to add the file:// on the front as I can't get it to work even when hard coding the strings using append.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSBundle getting location of file in bundle (From: Mark Bateman <email@hidden>)

  • Prev by Date: NSBundle getting location of file in bundle
  • Next by Date: Re: NSBundle getting location of file in bundle
  • Previous by thread: NSBundle getting location of file in bundle
  • Next by thread: Re: NSBundle getting location of file in bundle
  • Index(es):
    • Date
    • Thread