iOS App 开发问题汇总（三）
1.Checking the Entitlements for an iOS app Submission to the App Store
Making an Inspectable .ipa file
In the Xcode Organizer, instead of Submit to the iOS App Store, do Save for Enterprise or Ad-Hoc Deployment. This will create a local copy of the .ipa file that would be submitted to the App Store.
When asked to choose the provisioning profile to sign with, select the same distribution profile you use when submitting to the App Store. Take a screenshot of your choice (command-shift-3) so you can verify this step later. During submission, this screenshot will be the only record you have identifying which profile was used to sign the app.
When asked to save the package, uncheck Save for Enterprise Distribution, then save the .ipa file.
Checking the Entitlements of an .ipa file
Find the .ipa file and change its the extension to .zip.
Expand the .zip file. This will produce a Payload folder containing your .app bundle.
Use the codesign tool to check the entitlements on the .app bundle like this: $ codesign -d –entitlements :- “Payload/YourApp.app” where YourApp.app is the actual name of your .app bundle.
Use the security tool to check the entitlements of the app’s embedded provisioning profile: // should add cms, Apple may be a typo $ security cms -D -i “Payload/YourApp.app/embedded.mobileprovision”
where YourApp.app is the actual name of your .app bundle.
1. I opened the .pbxproj file in a text editor.
a. Go to your .xcodeproj
b. Right click -> Show package contents
c. Open .pbxproj with a text editor.
2. I searched for the UUID.
3. Turns out that is a static library folder already removed from reference.
4. I readd folder that contain the static library.
5. Rerun pod installation.
6. Issue not happening anymore! :D
3.How do I return to an older version of our code in Subversion?
1 2 3
4. Add top layout guide in NIB file
1 2 3 4
5. How do I set the height of tableHeaderView (UITableView) with autolayout?
6. How to resize superview to fit all subviews with autolayout?
7.How to use c++ and objective-c together in XCode 4.2
8.How do I change the status bar content to white?
A:In iOS 7 and later, status bar behavior is determined by view controllers. We can set the disired style via overriding property preferredStatusBarStyle.
1 2 3
Apple note childViewControllerForStatusBarStyle method can override the preferred status bar style for a view controller, so when a view controller is a child of UINavigationController thing changed, we have to adjust UINavigationController’s default childViewControllerForStatusBarStyle implement as follow:
1 2 3 4 5 6 7 8 9
Reference:UIStatusBarStyle not working in Swift
1 2 3 4 5
10.fastlane add Slack Notifications
Create an Incoming WebHook and export this as SLACK_URL. Can send a message to #channel (by default), a direct message to @username or a message to a private group group with success (green) or failure (red) status.
Slack > Menu > API > Incoming Webhooks > Set up an incoming webhook integration in your Slack team to try it out.
Solution:Further to a migration of my Xcode project, from Xcode 6.4 to Xcode 7, I get the warning message below (after compilation) for the Test target :
directory not found for option ‘-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks’ Actually I found something when comparing a new project vs an older one…
In the old project, the warning was only being produced by the test target of my projects. Under ‘Search Paths’, I found it was including two items under ‘Framework Search Paths’:
$(SDKROOT)/Developer/Library/Frameworks $(inherited) The new project kept the ‘Framework Search Paths’ empty.
Deleting those entries in my older project then removed the warning.
Reference:Xcode 7 Library search path warning
Solution:disable bitcode for this target. App target > Build Settings > Enable Bitcode > NO
Reference:New warnings in iOS 9
Solution:Target > Lister > iCloud > Fix issue Target > App Group > Fix issue
14.How can I conditionally include a file based on build configuration in Xcode?
For each target for which you want to conditionally include the settings bundle, choose its Project from the source list, choose the target, and switch to the “Build Phases” tab.
Click the “Add Build Phase” button and choose “Add Run Script”.
Then enter the following for the script:
1 2 3
15.Automatic Preferred Max Layout Width is not available on iOS versions prior to 8.0
Solution: 1. Go to Issue Navigator (CMD+8) and Select latest built with the warning
2. Locate the warning(s) (search for “Automatic Preferred Max Layout”) and press expand button on the right
3. Find the Object ID of the UILabel
4. Open the Storyboard and SEARCH (CMD+f) for the object. It will SELECT AND HIGHLIGHT the UILabel
5. Explictit set preferred layout width