开发者

My MainViewController is getting big. How can I divide it?

I am using XCode 4.0.2 for a iOS4 (iPhone) project with a great number (40) FieldText and other objects (a slider for example).

I have a MainViewController.h and a MainViewController.m among other things (AppDelegate, FlipsideViewController, custom classes, etc).

Now the MainViewController.m is getting big (1700 rows). How can I divide this in two o three files? Perhaps moving some 开发者_如何学编程delegate methods in a new file? Or something else?

Thank you.

Mauro


Delegate methods are good candidates to be factored out.

You could also try some general refactoring techniques, e.g., if you identify functionality that seems likely to be reused in other classes that could guide your redesign.

Anyway, without seeing the code is really difficult to come up with more concrete suggestions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜