如何访问MainClass中的SubClass功能? [英] How to access the SubClass features in MainClass?

查看:38
本文介绍了如何访问MainClass中的SubClass功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于这个问题,我以前的问题是.如何在一个MainClass中访问多个类数据?现在,为了使我的问题更清楚,我在此处提供源代码 SourceCode.作为我的源代码显示我在我的主类中声明了所有类,并且我的代码在我的主类中.但是我想将所有主类代码放入我在应用程序中创建的相关类中.和与第二类相关的代码放在第二类中.对我来说,现在的问题是,如果我将所有代码都放置到第二类中相关的类中,那么我们将如何访问这些类.任何帮助都会被分配?

About this problem my previous question is that. How to Access Multiple Classes data in One MainClass? Now to make my problem more clear i provide source code here SourceCode. As my source Code show i declare all the classes in my mainclass and my coding is in my mainclass.But i want to place all my mainclass code to its related class that i create in my application.For Exp Code related to first Class i want to place all there and Code related to Second Class place in Second Class.Now problem for me is that if i place all code to its related Classes then how we can access these Classes.Any Help will be appriated?

推荐答案

如果要添加表,请在主类/控制器中添加视图.然后创建所有其他对象,并在其中创建一个表/视图作为子类,并从xib更改类名称.

If you are adding the tables, views in the main class/controller. Then create all other objects with in that as subclass a table/views and from xib change the class name.

示例我已经对第一视图&第二个视图作为UIView的子类.

The sample one i have made the changes for first view & second view as subclass of UIView.

还有您在主类中制作的动画,我通过传递执行该功能所需的视图/对象而从第一类或第二类中制作出来.

And the animations which you made in main class, i have made it from the first-class or second-class by passing the required views/objects to perform that function.

查看我所做的更改.

这篇关于如何访问MainClass中的SubClass功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆