HelloWorld
HelloWorld

Reputation: 7286

How do I open .app file by objective-c?

I make a cocoa program,I want to unzip .app all files to a path use objective-c ,How do I do ? Thank you for any idea.

Upvotes: 0

Views: 779

Answers (3)

Monolo
Monolo

Reputation: 18253

As mentioned by others, a .app file is just a directory (also known as a bundle), so there is nothing to unzip there.

If you want to see it, right click the app icon in the Finder, then choose "Show Package Contents" from the menu.

From Objective-C you can access the files within the app bundle as normal files.

And of course, if you are comfortable with the Terminal, you can peek into the structure from there. Open Terminal and try something like this:

$ cd /Applications
# The following line will show all apps:
$ ls -l 
# Change directory to get into the bundle (any app will do)
$ cd Safari.app
$ cd Contents
# Have a look:
$ ls -l

Upvotes: 2

Manuel Schmidt
Manuel Schmidt

Reputation: 128

NSWorkspace would allow you to launch .app's - if "launching" is what you mean with "opening".

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/Reference/Reference.html

Upvotes: 2

Abhinandan Sahgal
Abhinandan Sahgal

Reputation: 1076

You can open .app file directly by double clicking on it,I cannot understand what's so difficult about it.. Or you are trying to ask something else.

Upvotes: 0

Related Questions