This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 异常处理: | |
| void UncaughtExceptionHandler(NSException *exception) { | |
| NSArray *arr = [exception callStackSymbols]; | |
| NSString *reason = [exception reason]; | |
| NSString *name = [exception name]; | |
| NSString *url = [NSString stringWithFormat:@"=============异常崩溃报告=============\nname:\n%@\nreason:\n%@\ncallStackSymbols:\n%@", | |
| name,reason,[arr componentsJoinedByString:@"\n"]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void ignoring_signals() { | |
| signal(SIGINT,SIG_IGN); | |
| signal(SIGHUP, SIG_IGN); | |
| signal(SIGQUIT,SIG_IGN); | |
| signal(SIGPIPE,SIG_IGN); | |
| signal(SIGTTOU,SIG_IGN); | |
| signal(SIGTTIN,SIG_IGN); | |
| signal(SIGCHLD,SIG_IGN); | |
| signal(SIGTERM,SIG_IGN); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Combined all static libaries in the current directory into a single static library | |
| # It is hardcoded to use the i386, armv7, and armv7s architectures; this can easily be changed via the 'archs' variable at the top | |
| # The script takes a single argument, which is the name of the final, combined library to be created. | |
| # | |
| # For example: | |
| # => combine_static_libraries.sh combined-library | |
| # | |
| # Script by Evan Schoenberg, Regular Rate and Rhythm Software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)presentOverViewController:(ASViewController *)viewController | |
| { | |
| if ([[UIDevice currentDevice].systemVersion integerValue] >= 8) { | |
| //For iOS 8 | |
| viewController.providesPresentationContextTransitionStyle = YES; | |
| viewController.definesPresentationContext = YES; | |
| viewController.modalPresentationStyle = UIModalPresentationOverCurrentContext; | |
| [viewController presentViewController:self animated:NO completion:nil]; | |
| } | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(UIImage *)screenShot | |
| { | |
| CGRect originalFrame = self.frame; | |
| CGPoint originalOffset = self.scrollView.contentOffset; | |
| CGSize entireSize = [self sizeThatFits:CGSizeZero]; | |
| [self setFrame: CGRectMake(0, 0, entireSize.width, entireSize.height)]; | |
| CGRect rect = [self positionOfElementWithId:@"post1"]; | |
| //如果没有找到这个元素,就取整个页面 | |
| if (rect.origin.y != 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __weak typeof(self) weakSelf = self; | |
| __strong typeof(self) strongSelf = weakSelf; | |
| if (strongSelf) { | |
| <#statement#> | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIView+i7Rotate360.h | |
| // include7 AG | |
| // | |
| // Created by Jonas Schnelli on 01.12.10. | |
| // Copyright 2010 include7 AG. All rights reserved. | |
| // | |
NewerOlder