Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
345 views
in Technique[技术] by (71.8m points)

c - A Guide for Creating your own Library for Cocoa(touch) development

I'm currently using a lot of the same subclassed objects with custom methods. It would be more convenient to create my own library which I can use for several projects.

The goal is to have my own classes being available in the same way classes like UIView, CGRect etc are, including convenient methods like CGRectMake, both with classes and structs. To sum it up, I want to create my own equivalents of:

  • Classes like UIView
  • Structs like CGRect
  • Convenient functions like CGRectMake
  • Have this available as a library
  • Have this available as an XCode template, thus, having these custom Objects available as 'new files' in XCode

So basically I'm looking for instructions on how to create classes, structs etc in order to create all the above. What is the best way to do this? The 320 project seems like a good starting point. But it lacks (I think) in:

  • having the library available in new projects right away
  • having the new classes available under 'new file'

Even if I would create an own static library, will I be able to release the app on the app store, since linking to 3rd party libraries is not supported on the phone?

For your convenience, these are basically the sub questions, covering the scope of this question:

  • How can I create my own library for Mac / iPhone development?
  • How do I create classes, structs and inline function for this library?
  • How do I create my own Xcode template based on this library?
  • Will I be able to release iPhone apps using my own static library?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

FYI Xcode 3.2 has a new project template called Cocoa Touch Static Library. You might want to go that route.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...