• 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: Shaun Chu <email@hidden>
  • Date: Mon, 18 Mar 2002 18:41:03 -0500

I'm using

NSString *path = @"Users/shaun/textFile.txt";
NSString *text = [[NSString alloc] initWithContentsOfFile:path];

to set text to the contents of textFile.txt

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.


Thanks!

Shaun
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSString from .txt file
      • From: Markus Hitter <email@hidden>
  • Prev by Date: Re: debugging a System Preferences pane
  • Next by Date: NSButton setKeyEquivalent: leaving funny color?
  • Previous by thread: Re: Newbie with stupid question cont.
  • Next by thread: Re: NSString from .txt file
  • Index(es):
    • Date
    • Thread