0

BookmarksPlist 是一个 NSMutableArray,它作为字典存储在 Plist 文件中。以下代码...

bookmarks = [[NSMutableArray alloc] init];
NSLog(@"BOOKMARKPLIST ----==== %@", BookmarksPlist);
[bookmarks addObjectsFromArray:BookmarksPlist];
NSLog(@"BOOKMARK ----==== %@", bookmarks);

...产生:

2012-11-27 11:34:33.592 BOOKMARKPLIST ----==== {
    01Otabkey14tabkey1 = "Genesis 14";
    01Otabkey8tabkey1 = "Genesis 8";
    01Otabkey9tabkey1 = "Genesis 9";
}
2012-11-27 11:34:33.592 *** -[NSMutableArray addObjectsFromArray:]: array argument is not an NSArray
2012-11-27 11:34:33.593 BOOKMARK ----==== (
    01Otabkey8tabkey1,
    01Otabkey9tabkey1,
    01Otabkey14tabkey1
)

所以问题是如何让书签数组获取 BookmarksPlist 数组的值而不是键?所以它看起来像这样:

2012-11-27 11:34:33.593 BOOKMARK ----==== (
    "Genesis 14",
    "Genesis 8",
    "Genesis 9"
)
4

1 回答 1

1

BookmarksPlist可能是一本字典。您可以从字典中获取键,使用 获取allKeysallValues

于 2012-11-27T12:01:45.247 回答