开发者

Objective-C - Calling Methods in objects.

开发者 https://www.devze.com 2023-01-01 05:16 出处:网络
I\'m new to Objective-C, and I seem to be struggling with accessing a method of an object开发者_JAVA技巧 I created. I\'m checking out the documentation, but I\'m not entirely sure that this is a job f

I'm new to Objective-C, and I seem to be struggling with accessing a method of an object开发者_JAVA技巧 I created. I'm checking out the documentation, but I'm not entirely sure that this is a job for a delegate.

For example I have an object (1) that creates another object (2). I can access a method of the object (2) after I create it, but I can't access it from a method of object (1). I get a error that the object was not defined in this scope.

If anyone can help I greatly appreciate it. I just need a nudge in the right direction so that I can at least get a grasp on how to think about the interaction between the objects.


Turns out I did not define the object in @interface. This caused my methods to not have access to it. So for anyone with a similar issue, make sure to define your i-vars in the interface and not init :)

0

精彩评论

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