PDA

View Full Version : File Directory




dennisfett
Apr 17, 2011, 03:34 AM
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



robbieduncan
Apr 17, 2011, 03:34 AM
NSFileManager

dennisfett
Apr 17, 2011, 03:36 AM
Thanks for the fast reply...If i've got questions i know where to ask :)

dennisfett
Apr 17, 2011, 04:00 AM
hm...can i pls get an example of code, and where to put it!?

robbieduncan
Apr 17, 2011, 04:03 AM
hm...can i pls get an example of code, and where to put it!?

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.

dennisfett
Apr 17, 2011, 04:28 AM
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.

robbieduncan
Apr 17, 2011, 04:42 AM
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 (http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html). This is just one of the documents you should have read and understood all of before writing any code.

wlh99
Apr 17, 2011, 11:16 AM
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

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.

dennisfett
Apr 18, 2011, 01:25 AM
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...

SidBala
Apr 18, 2011, 04:20 AM
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.

dennisfett
Apr 18, 2011, 08:59 AM
Do you know any other object-oriented programming?

no

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

notjustjay
Apr 18, 2011, 10:21 AM
no

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

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!

jiminaus
Apr 18, 2011, 04:59 PM
Pls tell me how to learn everything! :o
Books/Links... if necessary

Check out the How do I get started programming on the Mac (or iPhone)? (http://guides.macrumors.com/Cocoa_FAQ) guide that appears at the top of this forum.

The Kochan and Hillegass books (in that order) suggested under What book do you recommend for learning Cocoa? (http://guides.macrumors.com/Cocoa_FAQ#What_book_do_you_recommend_for_learning_Cocoa.3F) are highly recommended.

Read the getting started and required reading material in the Mac OS X Developer Library (http://developer.apple.com/library/mac/navigation/).