I have a plist structured like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>1</key>
<array>
<string>George Washington</string>
<string>February 22, 1732 – December 14, 1799</string>
<string>Westmoreland, Virginia</string>
<string>April 30, 1789 – March 4, 1797</string>
<string>Non-partisan</string>
</array>
<key>2</key>
<array>
<string>John Adams</string>
<string>October 30, 1735 – July 4, 1826</string>
<string>Braintree, Massachusetts</string>
<string>March 4, 1797 – March 4, 1801</string>
<string>Federalist</string>
</array>
<key>3</key>
<array>
<string>Thomas Jefferson</string>
<string>April 13, 1743 – July 4, 1826</string>
<string>Shadwell, Virginia</string>
<string>March 4, 1801 – March 4, 1809</string>
<string>Democratic-Republican</string>
</array>
</dict>
</plist>
And I have this file in a a variable called filePath.
Let’s say I wanted to take array 1 from the plist, How could I make an NSArray from this?
Edit: Again, I want to create an array from a specific array within the plist.
When you read in the dictionary, the arrays it contains are created for you. You merely need to access them by asking for the
-objectForKey:using the appropriate key.