English 中文(简体)
增加国家安全局 Dictonary to NSMutable 射线,但物体被替换
原标题:Adding NSMutableDictonary to NSMutableArray but objects being replaced

每当我把一个新的物体NSMutable Dictionay添入我的NSMutable Array时,我如何取而代之?

例如:

[appDelegate.tracksDict setObject:currentTrackTitle forKey:@"track_title"];
[appDelegate.tracksDict setObject:currentTrackTopic forKey:@"topic"];
[appDelegate.tracksArray addObject:[appDelegate.tracksDict copy]];

印刷

2010-10-01 14:03:35.021 XML[48889:207]Tracks Array: {
    topic = "Cold Calling";
    "track_title" = "Sleeping and selling";
}
2010-10-01 14:03:35.021 XML[48889:207]Tracks Array: {
    topic = "Gate Keeper";
    "track_title" = "Selling like a chicken";
}
2010-10-01 14:03:35.021 XML[48889:207]Tracks Array: {
    topic = "Gate Keeper";
    "track_title" = "Don t you try to sell";
}

......

2010-10-01 14:03:35.021 XML[48889:207]Tracks Array: {
    topic = "Cold Calling";
    track_title = "Sleeping and selling";

    topic = "Gate Keeper";
    track_title = "Selling like a chicken";

    topic = "Gate Keeper";
    track_title = "Selling like a chicken";
}

我肯定说,我不很了解语言,那是一件事。

最佳回答

你的问题很难根据你所贴出的“印本”来回答,但是,你像想要的是NSDictionary物体的NSArray一样。 NSDictionary只能拥有一个特定关键物体,但可以(虚拟)拥有无限钥匙。 它看着你们需要的是建立一系列的独裁者,每个轨道都有一个。

问题回答

暂无回答




相关问题
Taking picture with QTCaptureView

Is it possible to simply take a picture and save it somewhere using a QTCaptureView and Apple s built-in iSight? I ve seen lots of tutorials on recording video but none on simply taking a picture. Any ...

Controlling OSX windows

I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...

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 ...

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 ...

How to get a flash url in a webpage using a webframe?

As we know , When we load frame from webpage of safari, we will invoke the delegate methods of webkit informal protocol(WebFrameLoadDelegate): webView:didStartProvisionalLoadForFrame: webView:...

热门标签