How can I unzip a file in MacOS X Obj-C? - cocoa

How can I unzip a file in MacOS X Obj-C? What frameworks do I need and what is the call?

You might find something helpful here at CocoaDev or with theunarchiver. theunarchiver is a nice utility that handles many archive formats and since it's open-source, you may be able to use some of their code to do what you want, though it's LGPL, which may or may not be compatible with what you're doing.

libz.1.2.3.dylib is the framework you should add to your project.
And use the the classes:
http://code.google.com/p/ziparchive/downloads/list

Related

How can I distribute my OSX command line Apps in my site?

I'm building OSX commandline apps. it's almost complete.
source code is open'd in my github.
but I want to distribute its "binary(Execute file)" as free ware but I can't understand the method.
simply should I extract execute file and place my blog?
I'm sorry because my english is poor.
Make sure you are building a release version of your app as described here How to deploy a Mac Command Line Tool
Then you can place the binary on your blog or on any other page. Make sure you are not using any libraries that may be missing from other people Macs.
Note it is always helpful if you add a description what your app does, how it needs to be called (arguments, ...) and maybe give some screenshots or in case of a command line app textual version of outputs.

OS X Installer limit a Package to OS version range

I have spent two days analyzing my options without coming up with a satisfying answer to this problem: what is the best and easiest way to set up an Installer that installs two different versions of of a package based on OS version range such as 10.6 - 10.8 and >10.8.
Is there an undocumented Key in PackageInfo that could be edited?
If I create a project, is there some code I could use in the Distribution.dist file to control the process of installing one package and not the other.
I really would rather not use a post flight script with ditto to do this, it would be really ugly.
Ideally, the excellent Packages would have an option, but does not.
I found the solution with the generous help from Stephane.
Using his excellent Packages IDE, it turns out that you can configure a range of options in the Installation Type Presentation pane.
Custom Install and Option can be hidden. It is possible to identify a large range of interdependent options that are linked. You can also create JavaScript, if this is not enough.
His IDE is highly recommended!
http://s.sudre.free.fr/Software/Packages/about.html

Revert XCode compression with pngcrush on windows?

I have some png images extracted from IPA files and I want to get the original PNG back, I was advised that pngcush did the task required so I downloaded it and tried running the following command:
pngcrush -fix icon.png icon1.png
But I get a libpng error. I don't know if libpng needs to be downloaded as well, since the error doesn't says that I need a different version of libpng, just says:
While reading icon.png:
pngcrush caught libpng error:
incorrect header check
I also tried this one:
pngcrush -revert-iphone-optimizations icon.png icn1.png
And pngcrush acts as if didn't knew the command.
Any ideas on what to do?
You may be interested in this C# library I developed to reverse what pngcrush does. All existing implementations I found were either riddled with bugs or too difficult to integrate into my project so I developed this. It has unit tests if that makes you feel safer.
The -iphone addition to pngcrush was added by Apple and is only available in the version of pngcrush in the iOS SDK, accessible by using xcrun like follows:
xcrun -sdk iphoneos pngcrush -iphone|-revert-iphone-optimizations ...
This answer: pngcrush: uncrush on linux? explains that -revert-iphone-optimizations is only present in the Apple version of pngcrush. But it does point to a couple of other options that might work. Linux, not Windows, but since there's source, you might get it to work.
Maybe you can try pngdefry.
Perfect dealing pngs with multiple IDAT tags.
It probably doesn't know the command. The documentation I found on -revert-iphone-optimizations comes from an apple developer page which refers to pngcrush being a part of the IOS SDK. Given that, i'd suggest it's been hacked into that specific version by apple and may not be part of the official pngcrush download. If that's true you'll actually need to install that and use the included pngcrush as explained in the article.
I'm also a bit suss on the syntax used in that example. It looks like a long option and they normally start with two hythens, not one. It could simply be a typo so try --revert-iphone-optimizations as well.

Can't make Ada work with Xcode 3.2

I've been looking around the web for an hour and I'm just giving up to ask it here...
I've got to work under Ada. I managed to make gnat work as a command line to compile my files.
But I want to be able to have proper projects in Xcode. My problem is that I've found some templates on the to make ada default templates, I've copy pasted them a bit everywhere (/library/developer/ application support etc) but they never appear in the list when I want to create a project.
My other problem is that when I create an empty project and add a .adb file to it I can't compile at all... How do I specify that I should use gnat with it?
I'm sorry for all these questions if they are stupid but I can't find the answer...
Two alternatives that may be of interest: the Ada plugin modules for NetBeans and the Ada 05 Language Module for BBEdit 9.x and TextWrangler 2.x .
FWIW, templates live in /Developer/Library/Xcode in Xcode 3.1.4.
If you are using the XCode Ada Plugin from here, it looks like it was made to work with Xcode 3.0. You might try downgrading to that and see if you have any better luck.
Personally, my IDE of choice is Emacs, so I can't go into any real detail about XCode past that. I'd suggest talking to the MacAda mailing list if you don't get a good answer here.

How can I create Xcode docsets that look and work like the ones in Apple Core Library

I want to create a docset for my API that looks and works like the Apple Core Library docset. For example, look at the page for NSString.
I've tried Doxygen and I've tried headerdoc2html. Neither does very close to what I want.
The files generated by headerdoc don't have most of the higher-level structure that the Apple files do, and the graphics design is different. Down at the more detailed level, like when looking at a specific method, things are closer, but don't have all the detailed structure.
The files generated by Doxygen have a very different high-level structure, not to mention having a very different graphic design.
What else should I try? Or are there parameters to either of these tools that would give me something closer?
Thanks, Pat
The best I have found so far is Tomaz's appledoc. With it I can create apple style api documentation and instal it directly into the DocSets that Xcode is uisng. Works very well and is based on doxygen.
You can use Doxygen to generate Xcode docsets.
Unfortunatelly, the Doxygen output looking and behaving like an Apple Developer Library Document is still to be discovered...
I'm also really interested in this :( Ive been able to generate docsets and doxygen docs but if I could make them look the same (or approaching) as the "normal" apple docs (like SDK ones), that would be better. :/

Resources