Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change item order in plist file

Tags:

xcode

plist

I want to change order in plist file not programmatically but from xcode. Is there a way in Xcode where i can sort by value? I simply want to arrange it for myself. For now if i want add new item it will always goes to tail.

Like here

How to sort it ? To 100 value go to the top?

like image 641
Jakub Avatar asked Jun 27 '12 11:06

Jakub


People also ask

How do I edit a .plist file on a Mac?

plist file. If you need to edit these items, Control-click (or right-click) Info. plist in the sidebar and select Edit Manually. This allows you to add or edit items in raw XML format.

How do I open Info plist on Mac?

Info. plist - The primary property list for Mac OS X applications, located in the /​Contents/​ directory of an . APP bundle. To view this file, right-click an application file, select "Show Package Contents," and open the Contents folder.


1 Answers

Here is the (mildly infuriating) answer, at least in the case of Items in a Settings.bundle's plist, which I realize was not the OP's situation.

To arbitrarily reorder items in a plist:

  1. Target the row by clicking within the Value column. The left-most columns don't allow dragging.
  2. Drag into the first ~64 pixels of the Key column. A blue line appears to indicate where the row will appear when you let go.

Here's a demonstration in Xcode 9.2.

enter image description here

As if that's not already super confusing…

Preference Items, Vertical Drag

You can drag and drop vertically (i.e., without entering the Key column), but only if your goal is to move the item to be first in the list.

enter image description here

Apple Clearly Knows How to Do This

Once you open an Item, elements within it can be dragged and dropped exactly as you'd expect.

enter image description here

Wat!? Yeah. This doesn't need to be so painful, but it's likely to remain this way unless folks get up in arms which, once you know the workaround, it's hard to do. But in case you're feeling sufficiently incensed, make your voice heard: http://bugreporter.apple.com. (Fwiw, here's my Open Radar.)

like image 97
clozach Avatar answered Oct 15 '22 09:10

clozach