I am interested in using the SBUsesNetwork
and UIRequiresPersistentWiFi
keys in my application; however, I would like to enable them only when using a certain set of view controllers. Is there a way to programmatically flip those key values while the application is running?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
I know you can get your info.plist as an NSDictionary via NSBundle with the following:
from there you could make a
mutableCopy
of theNSDictionary
and set the values therein. When making queries to the keys you'll have to make sure to query theNSDictionary
and not your info.plist file, but it shouldn't be hard to encapsulate all of this into a class that handles both problems for you.As for modifying your app's info.plist file directly there could be issues there (e.g, if you modify the file the code signing will fail and your app will be considered corrupt), though I'm not certain on this.
Info.plist is nothing but a dictionary. Hence it can be edited.
You cannot modify the Info.plist. There does not seem to be an Apple sanctioned way of doing what you are after.
I don't think this will work. [NSBundle mainBundle] has a pointer to a specific infoDictionary. Even though you take a mutable copy, NSBundle wouldn't know anything about our new plist. Anyone tried yet?
You can't modify your bundle contents while running, you don't have write access to that directory. I'm not sure there's a way to do exactly what you want.