i wanted to write a web crawler library for Objective-C ! but there is a library available for C language !
since we can compile C codes in our Objective-C projects in Xcode ! is there any reasonable purpose that we write a new library for Objective-C with itself syntax?
any performance ? or any reaso开发者_StackOverflown ?
thanks
Sure; lots of reasons.
The primary reason is if you want to hook the web crawler into an Objective-C application. For example, you might want to crawl the web and store results in Core Data for later local retrieval. Writing an Objective-C API makes it that much easier.
Wrapping a C based API in Objective-C is very easy, too. It is quite common to wrap C API in Objecitve-C to make the C based API that much easier to work with. OO patterns naturally encapsulate the notion of "session" or "context" that are typically represented by awkwardly managed manual malloc()d structures in C; those structures typically fit naturally into an Objective-C class.
精彩评论