Quantcast
Channel: OKWAVE 最新質問([技術者向] コンピューター/205)【本日】
Viewing all articles
Browse latest Browse all 38062

Xcodeのクラスについてお聞きします。

$
0
0
何らかのクラスをつくり、ViewControllerからクラスを生成して そのクラス(以下TestClass)のメソッドにアクセスします。 TestClassのメソッドから呼び出し元のViewControllerの変数若しくはメソッドに アクセスすることはできるのでしょうか? 例) @interface ViewController : UIViewController{ UIlabel *label; //TestClassから書き込みたい } @end @implementation ViewController -(void)viewDidLoad{ TestClass *class = [[TestClass alloc] init]; [class labelWrite];//クラス呼び出し } - (void)hoge{ //TestClassからここにアクセスしたい //処理 } @end @interface TestClass : NSObject @end @implementation TestClass - (void)labelWrite{ //ここからViewControllerのlabelに書き込みたい //もしくはViewControllerのhogeメソッドにアクセスしたい } @end

Viewing all articles
Browse latest Browse all 38062

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>