• 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
NSBundle getting location of file in bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSBundle getting location of file in bundle


  • Subject: NSBundle getting location of file in bundle
  • From: Mark Bateman <email@hidden>
  • Date: Thu, 5 Jun 2008 22:37:52 -0400

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


  • Follow-Ups:
    • Re: NSBundle getting location of file in bundle
      • From: "David Wilson" <email@hidden>
    • Re: NSBundle getting location of file in bundle
      • From: Michael Vannorsdel <email@hidden>
  • Prev by Date: Re: DTrace probe problem
  • Next by Date: Re: NSBundle getting location of file in bundle
  • Previous by thread: Re: Converting a MenuRef to a NSMenu
  • Next by thread: Re: NSBundle getting location of file in bundle
  • Index(es):
    • Date
    • Thread