<p>I am developing an iOS application, and trying to zip the file I have created in the application, is there any built in function able to do this?</p>

As Alex pointed out, I responded to
this question
by pointing out the
NSData category
contributed by users of the Cocoadev wiki.  That category includes methods for dealing with zipped and gzipped data in an NSData instance (that could be read from a Zip file or written to one).  This should be all you need to implement the file zipping you describe, as long as you can feed your file data into an NSData instance.
For an example of this category in action, please see the source code for my iPhone application,
Molecules
.  I only use the method to extract data from a gzipped file (in SLSMolecule+PDB.m), but you should be able to get the basic concepts from that.