• 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
what am I missing with NSString ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

what am I missing with NSString ?


  • Subject: what am I missing with NSString ?
  • From: vinai <email@hidden>
  • Date: Tue, 26 May 2009 06:33:01 -0700 (PDT)

Hi Folks,

I think I am missing something really basic here with NSString.  I am trying to store the path of a user-selected file (from an NSOpenPanel) internally so other routines can act on the data within the file.  Here's the relevant section of code:

    if ([oPanel runModalForDirectory:nil file:nil types:nil] == NSOKButton)
    {
        NSArray * files = [oPanel filenames];

        /* Process files */

        for( i = 0; i < [files count]; i++ )
        {
            [rawFileName initWithString: [[files objectAtIndex:i] stringByStandardizingPath]];
            NSLog(@"Logging the file name variable");
            NSLog(rawFileName);

            NSLog(@"Logging the called file path object directly");
            NSLog([[files objectAtIndex:i] stringByStandardizingPath]);
        }
    }

and this is the output from that section of code:

2009-05-26 09:18:41.931 REMI[19710:807] Logging the file name variable
2009-05-26 09:18:41.932 REMI[19710:807] Logging the called file path object directly
2009-05-26 09:18:41.932 REMI[19710:807] /Users/vinai/Desktop/rawTestData/P04608.7

rawFileName is declared to be an NSString * in my object's header file. So why does printing out the string returned by the stringByStandardizingPath function work okay, but not when initializing an NSString * variable with it ?  What would I need to rawFileName so it can be used by other methods in my object ?

Thanks much all.

vinai




_______________________________________________

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: what am I missing with NSString ?
      • From: Ken Thomases <email@hidden>
    • Re: what am I missing with NSString ?
      • From: Volker in Lists <email@hidden>
    • Re: what am I missing with NSString ?
      • From: Michael Vannorsdel <email@hidden>
  • Prev by Date: Re: Displaying a number with Quartz
  • Next by Date: Re: Displaying a number with Quartz
  • Previous by thread: Re: NSWindow in threads
  • Next by thread: Re: what am I missing with NSString ?
  • Index(es):
    • Date
    • Thread