0

I just finished my first application for Mac, and now works fine. The application has a main class of NSObject. This class has become huge, because I have many for loops and if-else statements. Since these cycles are repeated several times I wanted to know if you can put them in a separate class and call the point of the main class were i need them. But these cycles using variables defined in the main class. I'm a newbie and I would need a simple solution to understand and execute. Thank you.

4

1 回答 1

0

你的问题很笼统,它不仅适用于mac或客观编程顺便说一句。好吧,有几种方法可以解决这种情况,例如,您可以在新的分段类的方法中返回变量的值并将其分配到主类中。或者常见的方法是使用构造函数的引用。

于 2012-04-30T09:38:27.683 回答