• 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
NSString from .txt file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString from .txt file


  • Subject: NSString from .txt file
  • From: email@hidden
  • Date: Mon, 18 Mar 2002 20:49:32 -0800

Is there a way of accomplishing the same thing without using an absolute
path? In other words I want the textFile.txt to reside in the same folder
as the application and be able to move that folder to any directory without
breaking any path.

[[NSBundle mainBundle] bundlePath] should return the path to your application's bundle (i.e. the .app folder containing all your app's "stuff"). Using the methods in NSPathUtilities.h (which are documented in Foundation's NSString API reference) should let you concoct the path you want quite easily.
Good luck!

Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: click through view ?
  • Next by Date: Re: NSMatrix, changing selection of Radio Button
  • Previous by thread: Re: NSString from .txt file
  • Next by thread: NSButton setKeyEquivalent: leaving funny color?
  • Index(es):
    • Date
    • Thread