How to read a plist dictionary, and save the keys (not the values) in array strings of another plist?
<p>I´m creating a JB tweak with theos in my device.</p>

<p>I would like to read a plist dict like:</p>

<pre><code>ASNPrefs.plist

    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
    &lt;plist version="1.0"&gt;

        &lt;dict&gt;
            &lt;key&gt;ASNcenterEnabled&lt;/key&gt;
            &lt;false/&gt;
            &lt;key&gt;ASNcornerEnabled&lt;/key&gt;
            &lt;false/&gt;
            &lt;key&gt;ASNnoCenterEnabled&lt;/key&gt;
            &lt;false/&gt;
            &lt;key&gt;ASNdepthSizeEnabled&lt;/key&gt;
            &lt;false/&gt;
        &lt;/dict&gt;
        &lt;/plist&gt;
</code></pre>

<p>and write only the keys as an array into another plist like:</p>

<pre><code>ASNkeys.plist

    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
    &lt;plist version="1.0"&gt;

        &lt;dict&gt;
            &lt;key&gt;ASNkeys&lt;/key&gt;
            &lt;array&gt;
                &lt;string&gt;ASNcenterEnabled&lt;/string&gt;
                &lt;string&gt;ASNcornerEnabled&lt;/string&gt;
                &lt;string&gt;ASNnoCenterEnabled&lt;/string&gt;
                &lt;string&gt;ASNdepthSizeEnabled&lt;/string&gt;
            &lt;/array&gt;
        &lt;/dict&gt;
    &lt;/plist&gt;
</code></pre>

<p>I've created a button with this action, but nothing happens:</p>

<pre><code>- DEFINED AT BEGINNING OF .MM:


#define prefs @"/User/Library/Preferences/ASNPrefs.plist"
#define asnKeysPath @"/User/Documents/asnKeys.plist"
#define asnKeysDict [[NSDictionary dictionaryWithContentsOfFile:asnKeysPath] objectForKey:@"keys"]



- IN THE IMPLEMENTATION:


   -(void)ASNkeys {
        NSDictionary *asnPrefs = [NSDictionary dictionaryWithContentsOfFile:prefs];
        NSArray *allKeys = [prefs allKeys];

    [allKeys writeToFile:asnKeysDict atomically:YES];
        }
</code></pre>

<p>Thank you!</p>