Results 1 to 3 of 3
  1. #1

    Member Since
    Sep 20, 2009
    Output from a NSArray
    I have this code, that should list the files in a folder, in Debugger console it is working and displaying my files. But i my app, only the last file is displayed. What am i doing wrong..?
    (I am a totally newbee in cocoa)

    IBOutlet NSTextField *minFilesDislayoutput;

    NSFileManager *defaultManager = [NSFileManager defaultManager];
    NSArray *filePath = [defaultManager directoryContentsAtPath:@"/PDF"];
    int i , count = [filePath count];
    for ( i = 0 ; i < count ; i++ ) {
    NSLog(@" filepath is (%@)",[filePath objectAtIndex:i]);
    [minFilesDislayoutput setStringValue: [filePath objectAtIndex:i]];

  2. #2

    xstep's Avatar
    Member Since
    Jun 25, 2005
    On the road
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    Because you keep resetting the minFilesDislayoutput value through your loop to the value at the index you are at. You are not appending the value.

    I haven't played with NSTextFields like you are trying to, so don't know have a solution. Perhaps you want to look into NSTextView.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  3. #3

    Member Since
    Sep 20, 2009
    I can see what you mean....

    Thanks for you reply!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Possible to EQ the audio output
    By pmatyn in forum Music, Audio, and Podcasting
    Replies: 2
    Last Post: 02-07-2012, 01:42 AM
  2. Replies: 2
    Last Post: 11-19-2010, 04:34 AM
  3. HD Output?
    By HDMacbookUser in forum Apple Notebooks
    Replies: 1
    Last Post: 08-27-2009, 05:31 PM
  4. Ethernet output?
    By nickster914 in forum Apple Notebooks
    Replies: 4
    Last Post: 11-15-2008, 01:56 PM
  5. Optical output to 5.1?
    By TheThirdMan in forum Apple Desktops
    Replies: 0
    Last Post: 08-18-2007, 12:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts