开发者

DataSource on iOS

开发者 https://www.devze.com 2023-03-28 10:28 出处:网络
I come up with this thread, beca开发者_JAVA技巧use I would like to know what is the best method to implement a datasource class on iOS, when you have to access it from many classes.

I come up with this thread, beca开发者_JAVA技巧use I would like to know what is the best method to implement a datasource class on iOS, when you have to access it from many classes.

Is it ok to be a singleton class? Or is there any better method?


I don't think that's a bad idea at all. Implement the singleton as Apple suggest.

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW31 (search "Creating a Singleton Instance" in the page)

0

精彩评论

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