plist editing in XCode 4: Can you not move rows anymore?
Asked Answered
V

8

15

This one is stupid, and there's probably a ridiculously simple answer I'm just not aware of:

I'm trying to edit the plist for my Settings.bundle to implement preferences in my app. I want to tweak the order of a few groups, but I can't figure out how to move rows around. In XCode 3 you could just drag rows around to rearrange them, but it seems this no longer works in XCode 4. Short of deleting everything and re-recreating them in the correct order, how can I re-arrange the rows?

Thanks.

Volans answered 27/4, 2011 at 23:40 Comment(2)
Out of curiosity, I work quite a bit with Plists, does the order matter? (if you are trying to use this for user preference?) - Also if it does, I know this is an old post, but I'd recommend copying your Plist into a NSDictionary: but even then order of values inside an NSDictionary is determined at runtime (they're un ordered)Ph
In Xcode9 you can drag on the right side, not left as you might imagine, and drop into new location. It is very clunky but with practice you can get it to work.Illboding
M
7

I think it's an annoying gotcha that quite a few have run in to.

Check out:

How do you change a plist's root object type to NSArray in Xcode 4

and:

Change the editor Xcode 4 uses for property lists?

Basically, you can't. Changing the plist editor to textedit was the best solution for me. Also you can right click on the plist file and select "Open As > Source Code" to edit the plist raw.

Manifestation answered 19/7, 2011 at 15:38 Comment(0)
B
19

You can move an entry by grabbing the right side and moving it up, you just can't move it down.

Bellbottoms answered 2/11, 2012 at 14:7 Comment(2)
Gotta love how intuitive Mac/Apple products are.Funny
This still works in Xcode 13.1. Thanks for the hint!Barbosa
M
7

I think it's an annoying gotcha that quite a few have run in to.

Check out:

How do you change a plist's root object type to NSArray in Xcode 4

and:

Change the editor Xcode 4 uses for property lists?

Basically, you can't. Changing the plist editor to textedit was the best solution for me. Also you can right click on the plist file and select "Open As > Source Code" to edit the plist raw.

Manifestation answered 19/7, 2011 at 15:38 Comment(0)
C
2

It looks like the same problem is back in XCode 5. By grabbing it on the right you can drag it around, but you can't drop it anywhere. The only way I found was to open the list as source code like @Ralphleon said, which is simple enough to do if you have basic XML skills.

Corrinecorrinne answered 15/10, 2013 at 13:37 Comment(0)
V
1

Update: With the new XCode that comes with Lion and iOS 5, moving rows works again.

Volans answered 30/11, 2011 at 17:46 Comment(0)
K
1

Yes the order matters if you care about the order the preferences appear in your app settings.

I just create a new item (+) in the settings list where I would like an existing item placed. Then copy (right mouse click) that existing item and paste it on top of the new item. And then delete any duplicates.

Kindergartner answered 9/6, 2015 at 14:58 Comment(0)
H
0

In XCode 5.1, you can drag rows and drop them to a parent item. You can't rearrange siblings directly, but by dropping them on the parent item, the child jumps to the top among the siblings.

Heave answered 7/5, 2014 at 17:55 Comment(0)
S
0

Check out the app PlistEdit Pro. It handles everything properly. Not free. But if you're doing lots of plist work it's essential. Here

Ssm answered 3/9, 2014 at 16:0 Comment(0)
K
0

In Xcode 14.3, I figured out that an approach that worked was to figure out the reverse order of the settings (i.e. bottom to top), then select each entry in turn, dragging them to the top of the preference items array in that specific order. It did not seem to be possible to drag each row to any other place within the array than the top of it.

I find it rather ridiculous that the process is not simpler than this.

Klee answered 17/5, 2023 at 12:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.