iphone, xcode; Reverse engineer a nib
I was wondering if there is a way i can design a nib/xib file and generate code for that? meaning, instead of writing lines of code to generate an inte开发者_如何学JAVArface, would'nt it be easier to design and nib file using IB and get the source or something?
Thanks
I think that you may misunderstand what a nib file is.
If you mean that you'd rather create your view objects in interface builder and have outlets automatically inserted into your source files then look to XCode beta, it does that.
I don't think its possible in xcode to generate code for a nib file designed.I know you are referring to web designing tools like macromedia dreamweaver.
Secondly why do you require the code?X code provides the facility to integrate the nib in the code itself.
Thanks
You are asking for a code generator, which as jsd noted IB will do if you really want.
However, your life will be a lot easier if you just accept what IB is, an object creation, placement, linking and storage mechanism.
IB is doing all the tedious stuff for you, creating instances and setting initial values for you along with (some) relationships, then compositing them all. It freeze-dries the result so it's ready to go at runtime.
It does sometime make sense to use what IB has done as a template to base other code around instead of using the views it creates directly, but if you generate code then you are potentially out of sync with IB and it makes it hard to use for maintaining the interface going forward.
精彩评论