File Directory

Discussion in 'Mac Programming' started by dennisfett, Apr 17, 2011.

  1. macrumors newbie

    Joined:
    Apr 17, 2011
    #1
    Hi,

    i've just logged in first time in this forum. I'm new to Objective C and would like you to help me :cool:
    How to find a file directory in xCode and copy it for example to the Desktop?!

    Greetings
    Dennis
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    NSFileManager
     
  3. thread starter macrumors newbie

    Joined:
    Apr 17, 2011
    #3
    Thanks for the fast reply...If i've got questions i know where to ask :)
     
  4. thread starter macrumors newbie

    Joined:
    Apr 17, 2011
    #4
    hm...can i pls get an example of code, and where to put it!?
     
  5. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    I don't do examples. It is my firm belief that people just copy and paste without understanding what they are using which helps no one. I expect that there are examples in the Apple library.

    As to where to put it how can we possibly know? We have no idea what your code looks like, what your goals and aims are.

    I suggest you read the documentation and try things out. If you have code with specific questions or problems then you might get some help.
     
  6. thread starter macrumors newbie

    Joined:
    Apr 17, 2011
    #6
    ok.
    is that code right?
    - (BOOL)fileManager:(NSFileManager *)fileManager shouldCopyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath

    i've added a fileManager class to my project.
    If a button is pressed a folder should be copied to my Desktop. I don't know how to go on now. In the Apple Library is no example for that.
     
  7. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #7
    As noted in the documentation that is a delegate message. If you don't know what that means stop programming and go and read the documentation. This is just one of the documents you should have read and understood all of before writing any code.
     
  8. macrumors 6502

    Joined:
    Feb 7, 2008
    #8
    How new to Objective-C are you? Do you know any other object-oriented programming?

    What have you done you have so far on this project? Does it compile and do anything at all?

    What you are asking is non-trivial for someone with no experience. Quite frankly, if someone posted the entire code to do what you want, you likely still couldn't make it work.
     
  9. thread starter macrumors newbie

    Joined:
    Apr 17, 2011
    #9
    I'm really new, maybe 1 week ago i've started. I know not much...I can make an action and connect it in Interface Builder, so if a button is pressed anything happens. But i wouldn't know what to write, that anything happens. I will teach myself some basics now i think...
     
  10. macrumors 6502a

    Joined:
    Jun 27, 2010
    #10
    Do you have any prior programming experience?

    Programming is much more than knowing how to use the interface builder.

    To learn Obj-C, you really need to be familiar with C/C++ and OOP concepts.
     
  11. thread starter macrumors newbie

    Joined:
    Apr 17, 2011
    #11
    no

    What is OOP? :confused:
    Object Orientated Programing?
    Pls tell me how to learn everything! :eek:
    Books/Links... if necessary
     
  12. macrumors 603

    notjustjay

    Joined:
    Sep 19, 2003
    Location:
    Canada, eh?
    #12
    Yes, OOP is short for object oriented programming.

    I don't want to sound rude, but Google is going to be much more help to you than posting messages in a forum if you need to learn some basics. It's going to be way faster to get answers than waiting for people to reply, for one thing. There are lots of tutorials on the web. And you should get used to using Google for looking up code examples -- something even experienced programmers do all the time.

    In my job as a software engineer I use Google very regularly to look up APIs and get familiar with design patterns and data structures, especially when learning a new language. For example, when I had to quickly pick up some Ada, I didn't even know how to print text to the console, but Google bailed me out again and again.

    Best of luck to you as you begin your journey of learning!
     
  13. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #13

Share This Page