Background: I am about to start preparing my 1st framework for my clients, so they can easily integrate it into their apps and fetch data fr开发者_如何学Com my servers without dealing how communication with server is working. I chose ASIHTTPRequest
library for communication.
Question: how should I deal with ASIHTTPRequest
or any other static library - make it a part of my framework or let adopters link against it themselves in their projects?
I'm opting to make it a part of my framework, so I can prevent users from setting breakpoints in ASIHTTPRequest
and easily access/log connection frames/data. But what would happen if my clients will need this library for their own purposes? Will they be able to link it second time? Won't it cause any run-time collisions?
Sorry for wording... Please let me stand corrected if I'm confusing any terms :)
Look at how ASIHTTPRequest handle it :)
They make you link against lots of the iOS frameworks but they don't ship them with their download.
However, they do ship code for Reachability with their library - if you don't already have it then you can include it. If you already have it in your project then that's OK too.
I would ship the source of ASI in a seperate folder - then your users can either include it or not.
That also has the benefit of ensuring that the version of ASI they use will work with your library ;)
(see the ASI docs here)
There are two different types of frameworks to consider, so I would do two things:
For any third party library like ASI that you use, include a directory with the source as deanWombonurne indicated. Make sure to indicate which version of the library you have included if it is not clear (add a VERSION) file if needed or name the directory).
For Apple frameworks, include a manifest file somewhere that gives a list of all the Apple frameworks they should include in their project to satisfy your framework requirements.
精彩评论