从另一个iPhone开发类访问变量 [英] access a variable from another class iphone development
本文介绍了从另一个iPhone开发类访问变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法可以在不使用委托的情况下访问iphone中另一个类的变量的值?
Is there a way to access the value of a variable of another class in the iphone whithout using the delegate?
推荐答案
如果您编写getter方法或在实现中综合变量,则应该可以访问该变量.
you should be able to access the variable if you write a getter method or if you synthesize the variable in the implementation.
有关示例,请参阅Apple的本文档中的清单5.2. http://developer.apple.com/mac/library/iPad/index.html#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html
See listing 5.2 in this document from Apple for an example. http://developer.apple.com/mac/library/iPad/index.html#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html
这篇关于从另一个iPhone开发类访问变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文