Write a loop that prints every value in the NSArray args. What does it show? Post the output.
It should show the list args.
You should then add code in your main function that prints argc and each char* in argv, so you can compare the output with the NSArray output.
Now, given the output produced by the two loops, how does that have anything to do with listing the contents of the folder where the executable resides?
You originally wrote:
This is my code and I it doesn't display "moreThanOne" in the terminal, but it should, because I got in the folder "Debug" text-file and the executable file, and also one folder.
Clearly, you think that printing the args (the exercise above) should be the same as listing the contents of the folder where the executable resides. Or you think the arguments must be a list of the contents of that folder.
Neither of these is correct. The arguments are passed to the process. They aren't automatically set to the contents of the executable's folder.
To get the contents of a folder, you must do two things:
1. Get the pathname of a folder.
2. Use NSFileManager to list its contents.
If you haven't done 1, you can't do 2.
If you're learning from a book or tutorial, which one? (Title, author, edition, or tutorial URL.)
If you're working through an exercise from a book or tutorial, which one? (Chapter, page, exercise number.)