Failed to create UIBackgroundModes key in Info.plist for iOS4

I have a sound application that works great for versions of iPhone 3.1.x

I am trying to upgrade it to iOS4.0 to work in a multitasking environment. When I try to create a new UIBackgroundModes key in info.plist , it ("Required background modes") does not appear in the drop-down list?

I also upgraded the Xcode SDK to 3.2.3, the Base SDK to 4.0, the deployment target to 4.0, but still UIBackgroundModes (Required Backgrounds) will not appear in the info.plist drop-down list.

I also created a test project for 4.0, and its info.list drop-down has "Required Background Modes".

Did I miss something?

+6
iphone multitasking info.plist
source share
3 answers

You can add the key manually by editing the .plist file

  <key>UIBackgroundModes</key> <array> <string>audio</string> </array> 
+19
source share

Make sure that if you create an UIBackgroundModes element in Xcode (without manually editing the XML) that you create with the new key as an ARRAY type, add a new element (by default it will display as "Item 0") with the value "audio". If you just create a string key with the value "audio", this will not work.

+4
source share

Re Woodmantech answer: Xcode 3.2 changed the item a bit when adding this key to Xcode. The key is called "Necessary background modes", and for item 0 should be set to "Application plays audio." Both are accessible via the GUI drop-down menu.

+3
source share

All Articles