Is there a way to pass command line options to my iOS app from Xcode?

后端 未结 4 2009
半阙折子戏
半阙折子戏 2021-02-19 00:37

I\'m hoping to find a method to pass certain information in to my app when I launch it during testing, so that I can perform special debug tasks. Xcode has a section \"Arguments

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 01:04

    In addition to scalars, command line arguments can be an NSData, NSArray, or NSDictionary references. Apple's documentation on "Old-Style ASCII Property Lists" tells how to do it. https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/PropertyLists/OldStylePlists/OldStylePLists.html#//apple_ref/doc/uid/20001012-BBCBDBJE

    For example, this syntax should decode into an NSDictionary:

    MyApplication -aLocation "{ latitude = 37.40089; longitude = -122.109428; }"

提交回复
热议问题