简体   繁体   English

向AppDelegate添加XML值解析的NSMutableArray是好是坏?

[英]Adding a NSMutableArray which is Parsed XML value to a AppDelegate good or bad?

Is adding a NSMutableArray which is Parsed XML value to a AppDelegate good or bad practice? 是否在AppDelegate添加了将XML值解析为NSMutableArray好习惯?

Im trying to find the best solution for a fairly large XML that gets parsed and then added to a NSMutableArray . 我试图为解析后添加到NSMutableArray的相当大的XML找到最佳解决方案。

It's not a good practice to save data in AppDelegate . AppDelegate保存数据不是一个好习惯。 AppDelegate should be used for initialization and for receiving application level events as a mediator between OS and Application. AppDelegate应该作为OS和Application之间的中介程序用于初始化和接收应用程序级事件。

You can create a singleton DataManager which will keep all the data fetched in a session. 您可以创建一个单例DataManager ,以将所有数据保留在会话中。 Make Composite Model objects for your structures and keep them as collections in DataManager. 为您的结构制作Composite Model objects ,并将其保留为DataManager中的集合。 If you can provide more information about the type of data you are trying to persist, we can provide suggestions. 如果您可以提供有关您要保留的数据类型的更多信息,我们可以提供建议。

More read on Singleton Objects 有关单例对象的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 appdelegate中的NSMutableArray-EXEC_BAD_ACCESS - NSMutableArray in appdelegate - EXEC_BAD_ACCESS 从AppDelegate将NSMutableArray添加到TableView的Second Tab中 - Adding NSMutableArray to TableView in Second Tab from AppDelegate NSMutableArray和NSDictionary用于解析的xml数据 - NSMutableArray and NSDictionary using for parsed xml data iPhone SDK-如果要检查逻辑,我该怎么做。 检查NSMutableArray是否有针对解析的xml的可能值 - iphone sdk - how do i do this if else checking logic. checking an NSMutableArray for a possible value against parsed xml 在iPhone中进行XML解析并将值添加到NSMutableArray - Xml parsing in Iphone and adding values to NSMutableArray 将NSMutableArray添加到另一个NSMutableArray中时,最后一个数组值将被覆盖 - Last array value overwrite when adding NSMutableArray into another NSMutableArray 来自IBAction的AppDelegate addObject中的NSMutableArray - NSMutableArray in AppDelegate addObject from IBAction 在Xcode的appdelegate中添加UITabbarController吗? - Adding a UITabbarController in appdelegate in xcode? 查找存储在NSDictionary中的值的索引和存储在NSMutableArray中的NSDictionary的值的索引 - Find index of value which is stored into NSDictionary and NSDictionary stored into NSMutableArray NSMutableArray仅适用于25个项目 - NSMutableArray only good for 25 items
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM