English 中文(简体)
目标C 动态阵列
原标题:Objective C dynamic array creation

我有一个实体储存关于某一事件的一般信息。 在实体内,活动日期是储存的。

我认为,等级是这样,我就希望用户能够选择一年,这给在选定年份要求一个月的另一个观点带来了压力。 最后,我对在该月和该年发生的所有事件发表了看法。 如果用户选择和举办活动,那么用户可以进行编辑或查看细节。 表格表/导航控制器正在实施。

i.e. 2010
     2009 --> Dec
     2008     Nov --> Event 3
     2007     Oct     Event 2
                      Event 1 --> Detail View

由于用户增加了新的活动,本月和一年很可能发生变化。 我不想在几个月或几年内制造一个阵列,除非实际发生这样的事件。 我猜测,我会决定,如果把事件日期提一下,并利用一些方案逻辑,将其归入正确的月份和年度阵列,那么该条目将储存在什么阵列上。 然而,我的方案拟订经验使我稍感 down,我竭力争取执行,使我能生动地创造数目不明的阵列。 请有人解释如何做到这一点,或向我指出显示这一点的一篇文章/立场? 由于我没有幸运去搜寻,我很想知道这是否甚至可能?

最佳回答

您可以使用安全感。 你有一部大字典。

key -> value    
year -> NSDictionary           
        month -> ...

当你有新年时,如果你们的年复一年,你就能够进入可持续发展部,你可以把它看上去,把它放入一个月的字典。

问题回答

暂无回答




相关问题
Asynchronous request to the server from background thread

I ve got the problem when I tried to do asynchronous requests to server from background thread. I ve never got results of those requests. Simple example which shows the problem: @protocol ...

objective-c: Calling a void function from another controller

i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

NSUndoManager and runModalForWindow:

I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...

NSMutableArray values becoming "invalid"

I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...

iPhone numberpad with decimal point

I am writing an iPhone application which requires the user to enter several values that may contain a decimal point (currency values, percentages etc.). The number of decimal places in the values ...

热门标签