• 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
Odd NSString behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Odd NSString behavior


  • Subject: Odd NSString behavior
  • From: "McLaughlin, Michael P." <email@hidden>
  • Date: Wed, 24 Feb 2010 14:30:23 -0500
  • Acceptlanguage: en-US
  • Thread-topic: Odd NSString behavior

This is just a minor glitch but I hate loose ends.

I have a Cocoa app as a resource in my MainBundle.  If I try to get its
executable via the obvious

NSString * linrgPath = [myBundle pathForResource:
@"linrg2.app/Contents/MacOS/linrg2" ofType: @""];

then linrgPath is nil;

However, if I split the path into two pieces it works as intended.

NSString * linrgPath = [myBundle pathForResource: @"linrg2.app" ofType:
@""];
linrgPath = [linrgPath stringByAppendingString:@"/Contents/MacOS/linrg2"];

Is this reasonable?

FWIW, the full path expands to 104 chars and contains one space.

--
Mike McLaughlin

_______________________________________________

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: Odd NSString behavior
      • From: Sherm Pendley <email@hidden>
    • Re: Odd NSString behavior
      • From: Jens Alfke <email@hidden>
    • Re: Odd NSString behavior
      • From: Dave DeLong <email@hidden>
  • Prev by Date: Re: Stuck on NSTreeController bindings
  • Next by Date: Re: Odd NSString behavior
  • Previous by thread: NSFetchRequest with NSPredicate not fetches the expected objects (iPhone)
  • Next by thread: Re: Odd NSString behavior
  • Index(es):
    • Date
    • Thread