6

Hi i'm new to iOS development. There are many situations that we have to config our Info.plist. Most of the tutorial tell me to modify the Info.plist in my navigator panel. Just like this one (Info.plist).

However, modify this file doesn't work for me. Then i found another solution. Project -> Target -> Info, and you can find a "Custom iOS Target Properties". You can also set your property list here, and this work just fine for me.

So i'm wondering what's the difference between these two Info.plist? Since most of the tutorial point to the first one (which doesn't work for me), I think there must be something wrong. What should i do to make it work again? Thank you very much.

Kjuly
  • 34,476
  • 22
  • 104
  • 118
胡思宇
  • 131
  • 2
  • 4

2 Answers2

7

They're same, the Info.plist is the resource, and the 2nd one just refer to it. If you tried to delete the Info.plist file from your project, you cannot see the "Custom iOS Target Properties" you mentioned anymore, it'll show sth like:

Information from info.plist not available. File may not exist at specific path.

I think you must did sth wrong in Info.plist that lead your setting won't work.


Btw, make sure the target's info.plist refer to the right one that you want. Cause generally, we'll have Dev, Beta, etc schemes for our project, and they own different plist files as well.

So make sure the INFOPLIST_FILE refer to the right one in settings: enter image description here

Kjuly
  • 34,476
  • 22
  • 104
  • 118
  • Thank you for the clarification! But how can i make sure i'm referring to the correct file? I've checked Build Settings -> Packaging -> info.plist FILE. The path showed (MyProjectName)/Info.plist, seems correct to me? – 胡思宇 Jan 30 '16 at 06:21
  • @胡思宇 yup, it refers to the right one. so i think u might did sth wrong in info.plist while editing the resource. btw, what setting do u want to modify? And generally, if u can achieve what u want by editing "Custom iOS Target Properties", just do it there, editing pure plist resource file might lead the file unreadable if u did sth wrong. – Kjuly Jan 30 '16 at 06:29
  • I'm connecting my app to the server, and i got the messeage "App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file." . I've searched for answers online, and added "App Transport Security Settings" -> "Allow Arbitrary Loads"-> "YES" in my Info.plist. But nothing changed. Then i did the same thing again in my Custom iOS Target Properties, and everything turned out to be fine. So that drive me here to ask the question lol. – 胡思宇 Jan 30 '16 at 06:37
  • @胡思宇 weird, editing plist file to modify "App Transport Security Settings" is totally fine, once u done editing it, the setting in "Custom iOS Target Properties" should be updated as well. – Kjuly Jan 30 '16 at 06:50
  • 1
    Hey i just recreated an Info.plist with exactly the same content. I tried editing it again, and the "Custom iOS target Properties" did updated finally! Though still don't know what's the problem is, but thank you very much !! – 胡思宇 Jan 30 '16 at 07:11
3

Info.plist vs Custom iOS Target Properties

Info.plist[About] is equal to Custom iOS Target Properties

enter image description here

  1. Make sure that Build Settings -> Info.plist File(INFOPLIST_FILE) points to a necessary file(path location)
  2. Sometimes Xcode doesn't update Custom iOS Target Properties after changing Info.plist. You can restart Xcode as a variant
yoAlex5
  • 29,217
  • 8
  • 193
  • 205