Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to create UIBackgroundModes key in Info.plist for iOS4

I have an audio application which works great for iPhone 3.1.x versions.

I am trying to upgrade it to iOS4.0 to work in multitasking environment. When I try to create a new UIBackgroundModes key in info.plist, it ("Required Background Modes") doesn't show up in drop down list?

I also upgraded the Xcode SDK to 3.2.3, Base SDK to 4.0, deployment target to 4.0 but still UIBackgroundModes ("Required Background Modes") won't show up in info.plist drop down list.

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

Did I miss something?

like image 655
Cracker Jack Avatar asked Jul 15 '10 01:07

Cracker Jack


2 Answers

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

    <key>UIBackgroundModes</key>
    <array>
            <string>audio</string>
    </array>
like image 166
ohho Avatar answered Oct 19 '22 15:10

ohho


Be sure that if you create the UIBackgroundModes item in Xcode (not by editing the XML manually) that you create the new key as type ARRAY, then add a new item (it will appear as "Item 0" by default) with a value of "audio". If you simply create a string key with value "audio", it will not work.

like image 20
woodmantech Avatar answered Oct 19 '22 14:10

woodmantech