Can't add a new key-value pair without overwriting prior KVP


#1

At the end of Ch 6, just before the Bronze challenge (Sorry I don’t have page numbers as I’m using Kindle version) we were to add the 'Status bar is initially hidden" key-value-pair. The text says to:

“Select the last row and click the + icon next to the key name to add another key-value pair”.

When I do that it NEVER ads a new key-value pair. It simply overwrites whatever the last key-value pair was there. Am I doing something wrong. Has xCode changed in some way since the book was written (I’m using v. 4.5) of xcode. This is enormously frustrating. I have rebooted xCode to make sure that some gum isn’t in the works. I tried adding new blank projects to play around with things and I cannot seem to add a new key-value pair without overwriting a current one.

There must be another way to add a new key-value pair without nuking an existing one.

Help!


#2

Hm. Are you selecting an item in the list that is an array? (That is, does it have a disclosure tab next to it?) Is it adding an item to the array instead?


#3

I tried to upload an image but I can’t find any way of uploading an image to this forum.

No Joe, it isn’t an array issue. Regardless of where I try to add a new key-type row by clicking on the circled plus sign anywhere in the key-value list and it does the same thing - whether its a string, boolean or array. Well, more accurately, I should say it doesn’t do anything! :slight_smile:

For any item/row I hover my mouse over I get

  • the little up down arrow
  • to the right of that is a circle with a plus in it
  • beside that a circle with a minus in it.

Clicking the up down arrow allows me to select a new key-value pair but it replaces the current one. Clicking on the circle with the plus in it always does NOTHING. Clicking on the circle with the minus in it deletes that key-value pair.

This is so frustrating. I’ve created several blank test apps and they all do the same thing. I rebooted xcode and my iMac. Otherwise xcode is working just fine.

Is there a way to upload an image to a post so I can show what I’m seeing.

VERY FRUSTRATING!!!


#4

OK, I added a question over on Stack Overflow because there I could add an image to the question. Here’s the same question over there:

stackoverflow.com/questions/1273 … t-in-xcode

I that image you see the ‘Status bar is initially hidden’ key showing in the image. PLEASE NOTE: I was not able to add a new row to put that there. When it appeared for the purpose of the picture it appeared by overwriting the key that was on that line already.


#5

I’m having the exact same problem.

A workaround would seem to be to open the Hypnosister-Info.plist file from the Project Navigator and add it there, which does at least work as expected.


#6

Thank you so much mnemonix!!! I’m not going crazy! :slight_smile:

Yes, if I open the Hypnosister-info.plist file under the ‘Supporting Files’ folder, and right click anywhere in the resulting key-value table, I CAN click on Add Row and a new row for a new key-value pair appears. Yay!!!

A work around that works.!

I note that this works in all my other projects too. I think something must have changed with the latest version of Xcode!

Dale


#7

FWIW, I was able to change the key pair per the example in the book. (xCode 4.5.1).


#8

I was having the same problem. Thanks Dale for the workaround! :smiley:


#9

Based on that screenshot, the window is cut off on the right hand side… try shrinking the project window to something where you can see the right edge?