Category: iOS 開發 Q&A
[iOS]How to trace crash log with symbolicatecrash
1 | /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash crash.log MyApp.app.dSYM > symbol_crash.log |
Tags : dsym
[Q&A] Error Itms-90339: This bundle is invalid . The info.plist contains an invalid key ‘CFBundleResourceSpecification’ in app bundle
1. remove
1 | CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist |
2. modify
1 | /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication |
change
1 2 3 | my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules", "--sign", $opt{sign}, "--resource-rules=$destApp/ResourceRules.plist"); |
to
1 2 | my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements", "--sign", $opt{sign}); |
3. change file permission
1 | sudo chown myuser /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/ResourceRules.plist |
Tags : ios
[Q&A] How to enable silent notification in iOS
set content-available = 1
Provide this key with a value of 1 to indicate that new content is available. Including this key and value means that when your app is launched in the background or resumed,application:didReceiveRemoteNotification:fetchCompletionHandler: is called.
(Newsstand apps are guaranteed to be able to receive at least one push with this key per 24-hour window.)
Tags : apn, push notification
[QA]How to sort NSArray in 3 ways
Compare method
1 2 3 4 5 6 | - (NSComparisonResult)compare:(Person *)otherObject { return [self.birthDate compare:otherObject.birthDate]; } NSArray *sortedArray; sortedArray = [drinkDetails sortedArrayUsingSelector:@selector(compare:)]; |
NSSortDescriptor
1 2 3 4 5 6 | NSSortDescriptor *sortDescriptor; sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"birthDate" ascending:YES]; NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor]; NSArray *sortedArray; sortedArray = [drinkDetails sortedArrayUsingDescriptors:sortDescriptors]; |
Blocks
1 2 3 4 5 6 | NSArray *sortedArray; sortedArray = [drinkDetails sortedArrayUsingComparator:^NSComparisonResult(id a, id b) { NSDate *first = [(Person*)a birthDate]; NSDate *second = [(Person*)b birthDate]; return [first compare:second]; }]; |
[QA] How to center the content in UIWebView
Sorry, this entry is only available in 中文.
[QA] How to enable c++11 for android and ios
Sorry, this entry is only available in 中文.
Recent Comments