图片调整,暗黑模式屏蔽,加入防闪退代码

This commit is contained in:
kai60 2019-11-11 17:59:53 +08:00
parent 27ddecac30
commit 1448a02de0
30 changed files with 1747 additions and 3 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -2251,6 +2251,26 @@
88F5EFD81D48D08100CC7CAF /* MMVectorImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF591D48D08100CC7CAF /* MMVectorImage.m */; };
88F5EFD91D48D08100CC7CAF /* MyControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF5C1D48D08100CC7CAF /* MyControl.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
88F740C01ECC28E800876AED /* ShopAddGoodsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */; };
C024B79E2379668B00509424 /* NSArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B78A2379668B00509424 /* NSArray+AvoidCrash.m */; };
C024B79F2379668B00509424 /* AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B78B2379668B00509424 /* AvoidCrash.h */; };
C024B7A02379668B00509424 /* NSString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B78C2379668B00509424 /* NSString+AvoidCrash.m */; };
C024B7A12379668B00509424 /* NSDictionary+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B78D2379668B00509424 /* NSDictionary+AvoidCrash.m */; };
C024B7A22379668B00509424 /* NSAttributedString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B78E2379668B00509424 /* NSAttributedString+AvoidCrash.h */; };
C024B7A32379668B00509424 /* NSMutableDictionary+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B78F2379668B00509424 /* NSMutableDictionary+AvoidCrash.m */; };
C024B7A42379668B00509424 /* NSMutableString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B7902379668B00509424 /* NSMutableString+AvoidCrash.m */; };
C024B7A52379668B00509424 /* NSObject+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B7912379668B00509424 /* NSObject+AvoidCrash.m */; };
C024B7A62379668B00509424 /* NSMutableArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B7922379668B00509424 /* NSMutableArray+AvoidCrash.m */; };
C024B7A72379668B00509424 /* NSMutableAttributedString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B7932379668B00509424 /* NSMutableAttributedString+AvoidCrash.m */; };
C024B7A82379668B00509424 /* NSAttributedString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B7942379668B00509424 /* NSAttributedString+AvoidCrash.m */; };
C024B7A92379668B00509424 /* NSDictionary+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B7952379668B00509424 /* NSDictionary+AvoidCrash.h */; };
C024B7AA2379668B00509424 /* NSString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B7962379668B00509424 /* NSString+AvoidCrash.h */; };
C024B7AB2379668B00509424 /* AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B7972379668B00509424 /* AvoidCrash.m */; };
C024B7AC2379668B00509424 /* NSArray+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B7982379668B00509424 /* NSArray+AvoidCrash.h */; };
C024B7AD2379668B00509424 /* NSMutableDictionary+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B7992379668B00509424 /* NSMutableDictionary+AvoidCrash.h */; };
C024B7AE2379668B00509424 /* NSObject+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B79A2379668B00509424 /* NSObject+AvoidCrash.h */; };
C024B7AF2379668B00509424 /* NSMutableString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B79B2379668B00509424 /* NSMutableString+AvoidCrash.h */; };
C024B7B02379668B00509424 /* NSMutableAttributedString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B79C2379668B00509424 /* NSMutableAttributedString+AvoidCrash.h */; };
C024B7B12379668B00509424 /* NSMutableArray+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */; };
C0F0400C23756F3C00B61D3B /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0F0400B23756F3C00B61D3B /* ExternalAccessory.framework */; };
CB0F4E8622951A130091C76D /* SVRadialGradientLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = CB0F4E7B22951A130091C76D /* SVRadialGradientLayer.m */; };
CB0F4E8722951A130091C76D /* SVIndefiniteAnimatedView.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0F4E7C22951A130091C76D /* SVIndefiniteAnimatedView.h */; };
@ -5657,6 +5677,26 @@
88F5EF5C1D48D08100CC7CAF /* MyControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyControl.m; sourceTree = "<group>"; };
88F740BE1ECC28E800876AED /* ShopAddGoodsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopAddGoodsViewController.h; sourceTree = "<group>"; };
88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopAddGoodsViewController.m; sourceTree = "<group>"; };
C024B78A2379668B00509424 /* NSArray+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+AvoidCrash.m"; sourceTree = "<group>"; };
C024B78B2379668B00509424 /* AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrash.h; sourceTree = "<group>"; };
C024B78C2379668B00509424 /* NSString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AvoidCrash.m"; sourceTree = "<group>"; };
C024B78D2379668B00509424 /* NSDictionary+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+AvoidCrash.m"; sourceTree = "<group>"; };
C024B78E2379668B00509424 /* NSAttributedString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSAttributedString+AvoidCrash.h"; sourceTree = "<group>"; };
C024B78F2379668B00509424 /* NSMutableDictionary+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableDictionary+AvoidCrash.m"; sourceTree = "<group>"; };
C024B7902379668B00509424 /* NSMutableString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableString+AvoidCrash.m"; sourceTree = "<group>"; };
C024B7912379668B00509424 /* NSObject+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+AvoidCrash.m"; sourceTree = "<group>"; };
C024B7922379668B00509424 /* NSMutableArray+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+AvoidCrash.m"; sourceTree = "<group>"; };
C024B7932379668B00509424 /* NSMutableAttributedString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableAttributedString+AvoidCrash.m"; sourceTree = "<group>"; };
C024B7942379668B00509424 /* NSAttributedString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSAttributedString+AvoidCrash.m"; sourceTree = "<group>"; };
C024B7952379668B00509424 /* NSDictionary+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+AvoidCrash.h"; sourceTree = "<group>"; };
C024B7962379668B00509424 /* NSString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+AvoidCrash.h"; sourceTree = "<group>"; };
C024B7972379668B00509424 /* AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AvoidCrash.m; sourceTree = "<group>"; };
C024B7982379668B00509424 /* NSArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+AvoidCrash.h"; sourceTree = "<group>"; };
C024B7992379668B00509424 /* NSMutableDictionary+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableDictionary+AvoidCrash.h"; sourceTree = "<group>"; };
C024B79A2379668B00509424 /* NSObject+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+AvoidCrash.h"; sourceTree = "<group>"; };
C024B79B2379668B00509424 /* NSMutableString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableString+AvoidCrash.h"; sourceTree = "<group>"; };
C024B79C2379668B00509424 /* NSMutableAttributedString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableAttributedString+AvoidCrash.h"; sourceTree = "<group>"; };
C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+AvoidCrash.h"; sourceTree = "<group>"; };
C0F0400B23756F3C00B61D3B /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; };
CB0F4E7B22951A130091C76D /* SVRadialGradientLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVRadialGradientLayer.m; sourceTree = "<group>"; };
CB0F4E7C22951A130091C76D /* SVIndefiniteAnimatedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVIndefiniteAnimatedView.h; sourceTree = "<group>"; };
@ -11923,6 +11963,7 @@
88F5EEE81D48D04100CC7CAF /* libs */ = {
isa = PBXGroup;
children = (
C024B7892379668B00509424 /* AvoidCrash */,
CB484CE822B76DEC0075F050 /* GWP2PSDK */,
CB7D6AEA2296A1870014E5C7 /* AliPush */,
CB7D6A9722953BEB0014E5C7 /* YYCache */,
@ -12114,6 +12155,33 @@
path = Reachability;
sourceTree = "<group>";
};
C024B7892379668B00509424 /* AvoidCrash */ = {
isa = PBXGroup;
children = (
C024B78A2379668B00509424 /* NSArray+AvoidCrash.m */,
C024B78B2379668B00509424 /* AvoidCrash.h */,
C024B78C2379668B00509424 /* NSString+AvoidCrash.m */,
C024B78D2379668B00509424 /* NSDictionary+AvoidCrash.m */,
C024B78E2379668B00509424 /* NSAttributedString+AvoidCrash.h */,
C024B78F2379668B00509424 /* NSMutableDictionary+AvoidCrash.m */,
C024B7902379668B00509424 /* NSMutableString+AvoidCrash.m */,
C024B7912379668B00509424 /* NSObject+AvoidCrash.m */,
C024B7922379668B00509424 /* NSMutableArray+AvoidCrash.m */,
C024B7932379668B00509424 /* NSMutableAttributedString+AvoidCrash.m */,
C024B7942379668B00509424 /* NSAttributedString+AvoidCrash.m */,
C024B7952379668B00509424 /* NSDictionary+AvoidCrash.h */,
C024B7962379668B00509424 /* NSString+AvoidCrash.h */,
C024B7972379668B00509424 /* AvoidCrash.m */,
C024B7982379668B00509424 /* NSArray+AvoidCrash.h */,
C024B7992379668B00509424 /* NSMutableDictionary+AvoidCrash.h */,
C024B79A2379668B00509424 /* NSObject+AvoidCrash.h */,
C024B79B2379668B00509424 /* NSMutableString+AvoidCrash.h */,
C024B79C2379668B00509424 /* NSMutableAttributedString+AvoidCrash.h */,
C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */,
);
path = AvoidCrash;
sourceTree = "<group>";
};
CB0F4E622294F2B00091C76D /* Networking */ = {
isa = PBXGroup;
children = (
@ -12608,6 +12676,7 @@
files = (
FAA732D0227B2F7C0062C252 /* SetTimerModel.h in Headers */,
CBA6167C228F9AB100ED380D /* MASUtilities.h in Headers */,
C024B7A92379668B00509424 /* NSDictionary+AvoidCrash.h in Headers */,
3D1C50F8221A9EE00096AE43 /* des2.h in Headers */,
CB484E0422B8C8C80075F050 /* bprint.h in Headers */,
FAFC08232279CB5900B5A07B /* SetTimerCell.h in Headers */,
@ -12632,6 +12701,7 @@
3D1C5116221A9EE00096AE43 /* KTPhotoView+SDWebImage.h in Headers */,
3D1C50BB221A9EE00096AE43 /* RegisterResult.h in Headers */,
CBA6167F228F9AB100ED380D /* MASViewConstraint.h in Headers */,
C024B7A22379668B00509424 /* NSAttributedString+AvoidCrash.h in Headers */,
CB8B6468230F7F980032EB24 /* IfishMainInfoCell.h in Headers */,
CB484E1122B8C8C90075F050 /* version.h in Headers */,
3D1C5122221A9EE00096AE43 /* IfishRecVideoViewCell.h in Headers */,
@ -12654,6 +12724,7 @@
CB484E0B22B8C8C80075F050 /* version.h in Headers */,
CB484E1722B8C8C90075F050 /* dxva2.h in Headers */,
CB484DE622B8C8C80075F050 /* sha.h in Headers */,
C024B7AA2379668B00509424 /* NSString+AvoidCrash.h in Headers */,
FAA732D8227C1DA80062C252 /* Xuanduo2TimerModel.h in Headers */,
3D1C50DC221A9EE00096AE43 /* PAIOUnit.h in Headers */,
CB7D6AA322953BEB0014E5C7 /* YYMemoryCache.h in Headers */,
@ -12719,6 +12790,7 @@
3D1C5115221A9EE00096AE43 /* ShotScreenImgViewController.h in Headers */,
3D1C5083221A9EDF0096AE43 /* KTThumbsViewController.h in Headers */,
3D1C50AF221A9EDF0096AE43 /* YFonc.h in Headers */,
C024B7AD2379668B00509424 /* NSMutableDictionary+AvoidCrash.h in Headers */,
CB484E0222B8C8C80075F050 /* mem.h in Headers */,
CB484DD922B8C8C80075F050 /* elian.h in Headers */,
CB4820562334E30300A50C92 /* HKPieChartView.h in Headers */,
@ -12741,6 +12813,8 @@
3D1C5088221A9EDF0096AE43 /* KTThumbsView.h in Headers */,
3D1C513F221A9EE10096AE43 /* FishControlThreedViewCell.h in Headers */,
FA0892F52270BED00084A609 /* XuanduoHuliModel.h in Headers */,
C024B79F2379668B00509424 /* AvoidCrash.h in Headers */,
C024B7AE2379668B00509424 /* NSObject+AvoidCrash.h in Headers */,
3D1C50C7221A9EE00096AE43 /* LocalDevice.h in Headers */,
3D1C50A0221A9EDF0096AE43 /* TouchButton.h in Headers */,
CBB0243723517947002900D5 /* MJExtension.h in Headers */,
@ -12755,13 +12829,16 @@
CBB0243923517947002900D5 /* MJPropertyKey.h in Headers */,
CBA61681228F9AB100ED380D /* NSLayoutConstraint+MASDebugAdditions.h in Headers */,
3D1C5109221A9EE00096AE43 /* P2PPlaybackController.h in Headers */,
C024B7B02379668B00509424 /* NSMutableAttributedString+AvoidCrash.h in Headers */,
CB484DE422B8C8C80075F050 /* base64.h in Headers */,
CB484E1922B8C8C90075F050 /* FfmpegInterface.h in Headers */,
CB4820842334E99700A50C92 /* IQToolbar.h in Headers */,
3D1C50B9221A9EDF0096AE43 /* CheckNewMessageResult.h in Headers */,
CB4820932334E99700A50C92 /* IQUIScrollView+Additions.h in Headers */,
CB48208E2334E99700A50C92 /* IQUIViewController+Additions.h in Headers */,
C024B7AC2379668B00509424 /* NSArray+AvoidCrash.h in Headers */,
CB48207D2334E99700A50C92 /* IQUIView+IQKeyboardToolbar.h in Headers */,
C024B7AF2379668B00509424 /* NSMutableString+AvoidCrash.h in Headers */,
CB48208A2334E99700A50C92 /* IQKeyboardReturnKeyHandler.h in Headers */,
CBA61678228F9AB100ED380D /* NSArray+MASShorthandAdditions.h in Headers */,
3D1C5095221A9EDF0096AE43 /* Alarm.h in Headers */,
@ -12833,6 +12910,7 @@
CB484DF122B8C8C80075F050 /* adler32.h in Headers */,
3D1C50A9221A9EDF0096AE43 /* MXSCycleScrollView.h in Headers */,
CB484E0322B8C8C80075F050 /* parseutils.h in Headers */,
C024B7B12379668B00509424 /* NSMutableArray+AvoidCrash.h in Headers */,
CB484DF822B8C8C80075F050 /* random_seed.h in Headers */,
CBA6167B228F9AB100ED380D /* NSArray+MASAdditions.h in Headers */,
CBA61688228F9AB100ED380D /* Masonry.h in Headers */,
@ -14311,6 +14389,7 @@
881671CB1EA5DE2B00BEBF23 /* UMComEditForwardView.m in Sources */,
883E76271D4897570030E075 /* DeviceModel.m in Sources */,
881B12401E1CCB8A004C074B /* RusunHaveHeateSetViewController.m in Sources */,
C024B7A32379668B00509424 /* NSMutableDictionary+AvoidCrash.m in Sources */,
88140AAC1D86C10D00FE34E5 /* IfishUDPBroadCastHelper.m in Sources */,
3D1C5130221A9EE10096AE43 /* IfishCameraRecordFourCell.m in Sources */,
883E78661D48A5E50030E075 /* ConnectInfoCollectionModel.m in Sources */,
@ -14538,6 +14617,7 @@
883BCD6F1ED555F20046283B /* IFishVideoPalyViewController.m in Sources */,
883283841EAF43BA00A47157 /* AIyuYanXuanViewController.m in Sources */,
886B806E1D6310F000E1B9B3 /* certificationViewFirstCell.m in Sources */,
C024B7A02379668B00509424 /* NSString+AvoidCrash.m in Sources */,
881671B11EA5DE2B00BEBF23 /* UMComLoginViewController.m in Sources */,
88F5EFC11D48D08100CC7CAF /* FMDatabaseQueue.m in Sources */,
88C1B2BA1DD1745500C2C99A /* LXAdScrollView.m in Sources */,
@ -14603,6 +14683,7 @@
88C1B1FB1DCB6E8700C2C99A /* IfishNewsModel.m in Sources */,
88673B041E1F6A4F001D5F49 /* SongNuoBDProtocol.m in Sources */,
CB0F4E8622951A130091C76D /* SVRadialGradientLayer.m in Sources */,
C024B7A82379668B00509424 /* NSAttributedString+AvoidCrash.m in Sources */,
3D1C5114221A9EE00096AE43 /* KTThumbView+SDWebImage.m in Sources */,
88645B1B1E83B81E00234DB4 /* IfishInfoDetailPingLunCell.m in Sources */,
881671B31EA5DE2B00BEBF23 /* UMComRegisterViewController.m in Sources */,
@ -14769,11 +14850,13 @@
88D3373C1DC7440C006C0ADB /* IfishConnectingView.m in Sources */,
8856B0EC1DED4AE0009D384A /* IfishUserDefaultHelper.m in Sources */,
881671C41EA5DE2B00BEBF23 /* UMComTableViewCell.m in Sources */,
C024B7AB2379668B00509424 /* AvoidCrash.m in Sources */,
3D1C50DA221A9EE00096AE43 /* RecommendInfo.m in Sources */,
883E79B21D48B0280030E075 /* MerchantCell.m in Sources */,
883E76421D4897570030E075 /* TimerSateModel.m in Sources */,
CB484CF922B8B0AC0075F050 /* GCDAsyncUdpSocket.m in Sources */,
881869341D6FDD3B00CE9DFF /* ShopKanHuP2PViewController.m in Sources */,
C024B79E2379668B00509424 /* NSArray+AvoidCrash.m in Sources */,
CBA6168C228F9AB100ED380D /* MASViewAttribute.m in Sources */,
88602DB91E10D97E00F3DB5D /* UIButton+WebCache.m in Sources */,
883E762F1D4897570030E075 /* TemperatureSetModel.m in Sources */,
@ -14805,6 +14888,7 @@
881671D61EA5DE2B00BEBF23 /* UMComSysCommentCell.m in Sources */,
885C43B31E89F79D00685A2E /* IfishLiveListViewCell.m in Sources */,
CB4820902334E99700A50C92 /* IQUIScrollView+Additions.m in Sources */,
C024B7A62379668B00509424 /* NSMutableArray+AvoidCrash.m in Sources */,
881671D51EA5DE2B00BEBF23 /* UMComChatRecodTableViewCell.m in Sources */,
883E76241D4897570030E075 /* DropViewModel.m in Sources */,
8891330A1ECE999A00F52EBC /* IfishShopGoodsVideoRecordViewController.m in Sources */,
@ -14879,14 +14963,17 @@
880707FE1DE6C18A0076F65A /* KanKanListDataHelper.m in Sources */,
88F5EFA91D48D08100CC7CAF /* AFHTTPRequestOperation.m in Sources */,
3D1C50CF221A9EE00096AE43 /* ConnectFailurePromptView.m in Sources */,
C024B7A52379668B00509424 /* NSObject+AvoidCrash.m in Sources */,
CB5B9B1922EEC4BC00F0DFB1 /* UIView+Toast.m in Sources */,
883E78441D48A5E50030E075 /* KeLiAiBackmassageDataUnity.m in Sources */,
881671AF1EA5DE2B00BEBF23 /* UMComUserAlbumDataController.m in Sources */,
881671B01EA5DE2B00BEBF23 /* UMComLoginManager.m in Sources */,
C024B7A12379668B00509424 /* NSDictionary+AvoidCrash.m in Sources */,
88F5EE4C1D48CA2800CC7CAF /* ESP_ByteUtil.m in Sources */,
883E79C61D48B0280030E075 /* SetCell.m in Sources */,
881671E71EA5DE2B00BEBF23 /* UMComAddedImageCellView.m in Sources */,
881672181EA5DE2B00BEBF23 /* UMComSimpleGridViewerController.m in Sources */,
C024B7A42379668B00509424 /* NSMutableString+AvoidCrash.m in Sources */,
88F5EFCA1D48D08100CC7CAF /* JHRefreshHeaderView.m in Sources */,
88F5EFAC1D48D08100CC7CAF /* AFNetworkReachabilityManager.m in Sources */,
883E783B1D48A5E50030E075 /* StoreViewController.m in Sources */,
@ -15120,6 +15207,7 @@
CB7D6AA222953BEB0014E5C7 /* YYCache.m in Sources */,
883E79B91D48B0280030E075 /* LYHelper.m in Sources */,
886185CA1EF2290000459AD1 /* FourControlNameViewController.m in Sources */,
C024B7A72379668B00509424 /* NSMutableAttributedString+AvoidCrash.m in Sources */,
881F0F541D73DF680091507E /* BaoGaoViewSecondCell.m in Sources */,
883E78491D48A5E50030E075 /* NoneControlNonetimerViewController.m in Sources */,
880707451DDD3EF50076F65A /* P2PShareView1Cell.m in Sources */,

BIN
Ifish/.DS_Store vendored

Binary file not shown.

View File

@ -80,6 +80,7 @@
//
#import <AlibcTradeSDK/AlibcTradeSDK.h>
#import "IfishADTimerViewController.h"
#import "AvoidCrash.h"
@interface AppDelegate ()
@property(nonatomic,strong)ICSDrawerController*ics;
@ -169,7 +170,9 @@
if (data != nil) {
[self sendExceptionLogWithData:data path:dataPath];
}*/
#ifdef __OPTIMIZE__
[AvoidCrash becomeEffective];
#endif
//
[SMSSDK registerApp:SMSSDK_APPKey withSecret:SMSSDK_APPSec];
[SMSSDK enableAppContactFriends:NO];

Binary file not shown.

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "apcoonetc.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

View File

@ -0,0 +1,86 @@
//
// AvoidCrash.h
// AvoidCrash
//
// Created by mac on 16/9/21.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
//category
#import "NSObject+AvoidCrash.h"
#import "NSArray+AvoidCrash.h"
#import "NSMutableArray+AvoidCrash.h"
#import "NSDictionary+AvoidCrash.h"
#import "NSMutableDictionary+AvoidCrash.h"
#import "NSString+AvoidCrash.h"
#import "NSMutableString+AvoidCrash.h"
#import "NSAttributedString+AvoidCrash.h"
#import "NSMutableAttributedString+AvoidCrash.h"
/**
* if you want to get the reason that can cause crash, you can add observer notification in AppDelegate.
* for example:
*
* [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dealwithCrashMessage:) name:AvoidCrashNotification object:nil];
*
* ===========================================================================
*
* AppDelegate中监听通知
* 线crash,线
*
*/
#define AvoidCrashNotification @"AvoidCrashNotification"
//user can ignore below define
#define AvoidCrashDefaultReturnNil @"This framework default is to return nil to avoid crash."
#define AvoidCrashDefaultIgnore @"This framework default is to ignore this operation to avoid crash."
#ifdef DEBUG
#define AvoidCrashLog(...) NSLog(@"%@",[NSString stringWithFormat:__VA_ARGS__])
#else
#define AvoidCrashLog(...)
#endif
@interface AvoidCrash : NSObject
/**
* become effective . You can call becomeEffective method in AppDelegate didFinishLaunchingWithOptions
*
* .AppDelegate的didFinishLaunchingWithOptions方法中调用becomeEffective方法
*
* :
* [NSArray avoidCrashExchangeMethod];
* [NSMutableArray avoidCrashExchangeMethod];
* .................
* .................
*/
+ (void)becomeEffective;
//user can ignore below method <用户可以忽略以下方法>
+ (void)exchangeClassMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
+ (void)exchangeInstanceMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
+ (void)noteErrorWithException:(NSException *)exception defaultToDo:(NSString *)defaultToDo;
@end

View File

@ -0,0 +1,200 @@
//
// AvoidCrash.m
// AvoidCrash
//
// Created by mac on 16/9/21.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "AvoidCrash.h"
#define AvoidCrashSeparator @"================================================================"
#define AvoidCrashSeparatorWithFlag @"========================AvoidCrash Log=========================="
#define key_errorName @"errorName"
#define key_errorReason @"errorReason"
#define key_errorPlace @"errorPlace"
#define key_defaultToDo @"defaultToDo"
#define key_callStackSymbols @"callStackSymbols"
#define key_exception @"exception"
@implementation AvoidCrash
/**
* ()
*/
+ (void)becomeEffective {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[NSObject avoidCrashExchangeMethod];
[NSArray avoidCrashExchangeMethod];
[NSMutableArray avoidCrashExchangeMethod];
[NSDictionary avoidCrashExchangeMethod];
[NSMutableDictionary avoidCrashExchangeMethod];
[NSString avoidCrashExchangeMethod];
[NSMutableString avoidCrashExchangeMethod];
[NSAttributedString avoidCrashExchangeMethod];
[NSMutableAttributedString avoidCrashExchangeMethod];
});
}
/**
*
*
* @param anClass
* @param method1Sel 1
* @param method2Sel 2
*/
+ (void)exchangeClassMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel {
Method method1 = class_getClassMethod(anClass, method1Sel);
Method method2 = class_getClassMethod(anClass, method2Sel);
method_exchangeImplementations(method1, method2);
}
/**
*
*
* @param anClass
* @param method1Sel 1()
* @param method2Sel 2()
*/
+ (void)exchangeInstanceMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel {
Method originalMethod = class_getInstanceMethod(anClass, method1Sel);
Method swizzledMethod = class_getInstanceMethod(anClass, method2Sel);
BOOL didAddMethod =
class_addMethod(anClass,
method1Sel,
method_getImplementation(swizzledMethod),
method_getTypeEncoding(swizzledMethod));
if (didAddMethod) {
class_replaceMethod(anClass,
method2Sel,
method_getImplementation(originalMethod),
method_getTypeEncoding(originalMethod));
}
else {
method_exchangeImplementations(originalMethod, swizzledMethod);
}
}
/**
* <>
*
* @param callStackSymbolStr
*
* @return
*/
+ (NSString *)getMainCallStackSymbolMessageWithCallStackSymbols:(NSArray<NSString *> *)callStackSymbols {
//mainCallStackSymbolMsg +[ ] -[ ]
__block NSString *mainCallStackSymbolMsg = nil;
// +[ ] -[ ]
NSString *regularExpStr = @"[-\\+]\\[.+\\]";
NSRegularExpression *regularExp = [[NSRegularExpression alloc] initWithPattern:regularExpStr options:NSRegularExpressionCaseInsensitive error:nil];
for (int index = 2; index < callStackSymbols.count; index++) {
NSString *callStackSymbol = callStackSymbols[index];
[regularExp enumerateMatchesInString:callStackSymbol options:NSMatchingReportProgress range:NSMakeRange(0, callStackSymbol.length) usingBlock:^(NSTextCheckingResult * _Nullable result, NSMatchingFlags flags, BOOL * _Nonnull stop) {
if (result) {
NSString* tempCallStackSymbolMsg = [callStackSymbol substringWithRange:result.range];
//get className
NSString *className = [tempCallStackSymbolMsg componentsSeparatedByString:@" "].firstObject;
className = [className componentsSeparatedByString:@"["].lastObject;
NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(className)];
//filter category and system class
if (![className hasSuffix:@")"] && bundle == [NSBundle mainBundle]) {
mainCallStackSymbolMsg = tempCallStackSymbolMsg;
}
*stop = YES;
}
}];
if (mainCallStackSymbolMsg.length) {
break;
}
}
return mainCallStackSymbolMsg;
}
/**
* ()
*
* @param exception
* @param defaultToDo
*/
+ (void)noteErrorWithException:(NSException *)exception defaultToDo:(NSString *)defaultToDo {
//
NSArray *callStackSymbolsArr = [NSThread callStackSymbols];
// -[ ] +[ ]
NSString *mainCallStackSymbolMsg = [AvoidCrash getMainCallStackSymbolMessageWithCallStackSymbols:callStackSymbolsArr];
if (mainCallStackSymbolMsg == nil) {
mainCallStackSymbolMsg = @"崩溃方法定位失败,请您查看函数调用栈来排查错误原因";
}
NSString *errorName = exception.name;
NSString *errorReason = exception.reason;
//errorReason -[__NSCFConstantString avoidCrashCharacterAtIndex:]: Range or index out of bounds
//avoidCrash
errorReason = [errorReason stringByReplacingOccurrencesOfString:@"avoidCrash" withString:@""];
NSString *errorPlace = [NSString stringWithFormat:@"Error Place:%@",mainCallStackSymbolMsg];
NSString *logErrorMessage = [NSString stringWithFormat:@"\n\n%@\n\n%@\n%@\n%@\n%@\n\n%@\n\n",AvoidCrashSeparatorWithFlag, errorName, errorReason, errorPlace, defaultToDo, AvoidCrashSeparator];
AvoidCrashLog(@"%@",logErrorMessage);
//cocoapods
logErrorMessage = logErrorMessage;
NSDictionary *errorInfoDic = @{
key_errorName : errorName,
key_errorReason : errorReason,
key_errorPlace : errorPlace,
key_defaultToDo : defaultToDo,
key_exception : exception,
key_callStackSymbols : callStackSymbolsArr
};
//
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:AvoidCrashNotification object:nil userInfo:errorInfoDic];
});
}
@end

View File

@ -0,0 +1,25 @@
//
// NSArray+AvoidCrash.h
// AvoidCrash
//
// Created by mac on 16/9/21.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSArray (AvoidCrash)
+ (void)avoidCrashExchangeMethod;
@end
/**
* Can avoid crash method
*
* 1. NSArray的快速创建方式 NSArray *array = @[@"chenfanfang", @"AvoidCrash"]; //这种创建方式其实调用的是2中的方法
* 2. +(instancetype)arrayWithObjects:(const id _Nonnull __unsafe_unretained *)objects count:(NSUInteger)cnt
* 3. - (id)objectAtIndex:(NSUInteger)index
* 4. - (void)getObjects:(__unsafe_unretained id _Nonnull *)objects range:(NSRange)range
*/

View File

@ -0,0 +1,253 @@
//
// NSArray+AvoidCrash.m
// AvoidCrash
//
// Created by mac on 16/9/21.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "NSArray+AvoidCrash.h"
#import "AvoidCrash.h"
@implementation NSArray (AvoidCrash)
+ (void)avoidCrashExchangeMethod {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
//=================
// class method
//=================
//instance array method exchange
[AvoidCrash exchangeClassMethod:[self class] method1Sel:@selector(arrayWithObjects:count:) method2Sel:@selector(AvoidCrashArrayWithObjects:count:)];
//====================
// instance method
//====================
Class __NSArray = NSClassFromString(@"NSArray");
Class __NSArrayI = NSClassFromString(@"__NSArrayI");
Class __NSSingleObjectArrayI = NSClassFromString(@"__NSSingleObjectArrayI");
Class __NSArray0 = NSClassFromString(@"__NSArray0");
//objectsAtIndexes:
[AvoidCrash exchangeInstanceMethod:__NSArray method1Sel:@selector(objectsAtIndexes:) method2Sel:@selector(avoidCrashObjectsAtIndexes:)];
//objectAtIndex:
[AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSArrayIAvoidCrashObjectAtIndex:)];
[AvoidCrash exchangeInstanceMethod:__NSSingleObjectArrayI method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSSingleObjectArrayIAvoidCrashObjectAtIndex:)];
[AvoidCrash exchangeInstanceMethod:__NSArray0 method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSArray0AvoidCrashObjectAtIndex:)];
//getObjects:range:
[AvoidCrash exchangeInstanceMethod:__NSArray method1Sel:@selector(getObjects:range:) method2Sel:@selector(NSArrayAvoidCrashGetObjects:range:)];
[AvoidCrash exchangeInstanceMethod:__NSSingleObjectArrayI method1Sel:@selector(getObjects:range:) method2Sel:@selector(__NSSingleObjectArrayIAvoidCrashGetObjects:range:)];
[AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(getObjects:range:) method2Sel:@selector(__NSArrayIAvoidCrashGetObjects:range:)];
});
}
//=================================================================
// instance array
//=================================================================
#pragma mark - instance array
+ (instancetype)AvoidCrashArrayWithObjects:(const id _Nonnull __unsafe_unretained *)objects count:(NSUInteger)cnt {
id instance = nil;
@try {
instance = [self AvoidCrashArrayWithObjects:objects count:cnt];
}
@catch (NSException *exception) {
NSString *defaultToDo = @"This framework default is to remove nil object and instance a array.";
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
//nil,
NSInteger newObjsIndex = 0;
id _Nonnull __unsafe_unretained newObjects[cnt];
for (int i = 0; i < cnt; i++) {
if (objects[i] != nil) {
newObjects[newObjsIndex] = objects[i];
newObjsIndex++;
}
}
instance = [self AvoidCrashArrayWithObjects:newObjects count:newObjsIndex];
}
@finally {
return instance;
}
}
//=================================================================
// objectAtIndexedSubscript:
//=================================================================
#pragma mark - objectAtIndexedSubscript:
- (id)avoidCrashObjectAtIndexedSubscript:(NSUInteger)idx {
id object = nil;
@try {
object = [self avoidCrashObjectAtIndexedSubscript:idx];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
//=================================================================
// objectsAtIndexes:
//=================================================================
#pragma mark - objectsAtIndexes:
- (NSArray *)avoidCrashObjectsAtIndexes:(NSIndexSet *)indexes {
NSArray *returnArray = nil;
@try {
returnArray = [self avoidCrashObjectsAtIndexes:indexes];
} @catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
} @finally {
return returnArray;
}
}
//=================================================================
// objectAtIndex:
//=================================================================
#pragma mark - objectAtIndex:
//__NSArrayI objectAtIndex:
- (id)__NSArrayIAvoidCrashObjectAtIndex:(NSUInteger)index {
id object = nil;
@try {
object = [self __NSArrayIAvoidCrashObjectAtIndex:index];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
//__NSSingleObjectArrayI objectAtIndex:
- (id)__NSSingleObjectArrayIAvoidCrashObjectAtIndex:(NSUInteger)index {
id object = nil;
@try {
object = [self __NSSingleObjectArrayIAvoidCrashObjectAtIndex:index];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
//__NSArray0 objectAtIndex:
- (id)__NSArray0AvoidCrashObjectAtIndex:(NSUInteger)index {
id object = nil;
@try {
object = [self __NSArray0AvoidCrashObjectAtIndex:index];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
//=================================================================
// getObjects:range:
//=================================================================
#pragma mark - getObjects:range:
//NSArray getObjects:range:
- (void)NSArrayAvoidCrashGetObjects:(__unsafe_unretained id _Nonnull *)objects range:(NSRange)range {
@try {
[self NSArrayAvoidCrashGetObjects:objects range:range];
} @catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
} @finally {
}
}
//__NSSingleObjectArrayI getObjects:range:
- (void)__NSSingleObjectArrayIAvoidCrashGetObjects:(__unsafe_unretained id _Nonnull *)objects range:(NSRange)range {
@try {
[self __NSSingleObjectArrayIAvoidCrashGetObjects:objects range:range];
} @catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
} @finally {
}
}
//__NSArrayI getObjects:range:
- (void)__NSArrayIAvoidCrashGetObjects:(__unsafe_unretained id _Nonnull *)objects range:(NSRange)range {
@try {
[self __NSArrayIAvoidCrashGetObjects:objects range:range];
} @catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
} @finally {
}
}
@end

View File

@ -0,0 +1,25 @@
//
// NSAttributedString+AvoidCrash.h
// AvoidCrashDemo
//
// Created by mac on 16/10/15.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSAttributedString (AvoidCrash)
+ (void)avoidCrashExchangeMethod;
@end
/**
* Can avoid crash method
*
* 1.- (instancetype)initWithString:(NSString *)str
* 2.- (instancetype)initWithAttributedString:(NSAttributedString *)attrStr
* 3.- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs
*
*
*/

View File

@ -0,0 +1,96 @@
//
// NSAttributedString+AvoidCrash.m
// AvoidCrashDemo
//
// Created by mac on 16/10/15.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "NSAttributedString+AvoidCrash.h"
#import "AvoidCrash.h"
@implementation NSAttributedString (AvoidCrash)
+ (void)avoidCrashExchangeMethod {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class NSConcreteAttributedString = NSClassFromString(@"NSConcreteAttributedString");
//initWithString:
[AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithString:) method2Sel:@selector(avoidCrashInitWithString:)];
//initWithAttributedString
[AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithAttributedString:) method2Sel:@selector(avoidCrashInitWithAttributedString:)];
//initWithString:attributes:
[AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithString:attributes:) method2Sel:@selector(avoidCrashInitWithString:attributes:)];
});
}
//=================================================================
// initWithString:
//=================================================================
#pragma mark - initWithString:
- (instancetype)avoidCrashInitWithString:(NSString *)str {
id object = nil;
@try {
object = [self avoidCrashInitWithString:str];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
//=================================================================
// initWithAttributedString
//=================================================================
#pragma mark - initWithAttributedString
- (instancetype)avoidCrashInitWithAttributedString:(NSAttributedString *)attrStr {
id object = nil;
@try {
object = [self avoidCrashInitWithAttributedString:attrStr];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
//=================================================================
// initWithString:attributes:
//=================================================================
#pragma mark - initWithString:attributes:
- (instancetype)avoidCrashInitWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs {
id object = nil;
@try {
object = [self avoidCrashInitWithString:str attributes:attrs];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
@end

View File

@ -0,0 +1,24 @@
//
// NSDictionary+AvoidCrash.h
// AvoidCrash
//
// Created by mac on 16/9/21.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSDictionary (AvoidCrash)
+ (void)avoidCrashExchangeMethod;
@end
/**
* Can avoid crash method
*
* 1. NSDictionary的快速创建方式 NSDictionary *dict = @{@"frameWork" : @"AvoidCrash"}; //这种创建方式其实调用的是2中的方法
* 2. +(instancetype)dictionaryWithObjects:(const id _Nonnull __unsafe_unretained *)objects forKeys:(const id<NSCopying> _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt
*
*/

View File

@ -0,0 +1,56 @@
//
// NSDictionary+AvoidCrash.m
// AvoidCrash
//
// Created by mac on 16/9/21.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "NSDictionary+AvoidCrash.h"
#import "AvoidCrash.h"
@implementation NSDictionary (AvoidCrash)
+ (void)avoidCrashExchangeMethod {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[AvoidCrash exchangeClassMethod:self method1Sel:@selector(dictionaryWithObjects:forKeys:count:) method2Sel:@selector(avoidCrashDictionaryWithObjects:forKeys:count:)];
});
}
+ (instancetype)avoidCrashDictionaryWithObjects:(const id _Nonnull __unsafe_unretained *)objects forKeys:(const id<NSCopying> _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt {
id instance = nil;
@try {
instance = [self avoidCrashDictionaryWithObjects:objects forKeys:keys count:cnt];
}
@catch (NSException *exception) {
NSString *defaultToDo = @"This framework default is to remove nil key-values and instance a dictionary.";
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
//
NSUInteger index = 0;
id _Nonnull __unsafe_unretained newObjects[cnt];
id _Nonnull __unsafe_unretained newkeys[cnt];
for (int i = 0; i < cnt; i++) {
if (objects[i] && keys[i]) {
newObjects[index] = objects[i];
newkeys[index] = keys[i];
index++;
}
}
instance = [self avoidCrashDictionaryWithObjects:newObjects forKeys:newkeys count:index];
}
@finally {
return instance;
}
}
@end

View File

@ -0,0 +1,26 @@
//
// NSMutableArray+AvoidCrash.h
// AvoidCrash
//
// Created by mac on 16/9/21.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSMutableArray (AvoidCrash)
+ (void)avoidCrashExchangeMethod;
@end
/**
* Can avoid crash method
*
* 1. - (id)objectAtIndex:(NSUInteger)index
* 2. - (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx
* 3. - (void)removeObjectAtIndex:(NSUInteger)index
* 4. - (void)insertObject:(id)anObject atIndex:(NSUInteger)index
* 5. - (void)getObjects:(__unsafe_unretained id _Nonnull *)objects range:(NSRange)range
*/

View File

@ -0,0 +1,143 @@
//
// NSMutableArray+AvoidCrash.m
// AvoidCrash
//
// Created by mac on 16/9/21.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "NSMutableArray+AvoidCrash.h"
#import "AvoidCrash.h"
@implementation NSMutableArray (AvoidCrash)
+ (void)avoidCrashExchangeMethod {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class arrayMClass = NSClassFromString(@"__NSArrayM");
//objectAtIndex:
[AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(objectAtIndex:) method2Sel:@selector(avoidCrashObjectAtIndex:)];
//setObject:atIndexedSubscript:
[AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(setObject:atIndexedSubscript:) method2Sel:@selector(avoidCrashSetObject:atIndexedSubscript:)];
//removeObjectAtIndex:
[AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(removeObjectAtIndex:) method2Sel:@selector(avoidCrashRemoveObjectAtIndex:)];
//insertObject:atIndex:
[AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(insertObject:atIndex:) method2Sel:@selector(avoidCrashInsertObject:atIndex:)];
//getObjects:range:
[AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(getObjects:range:) method2Sel:@selector(avoidCrashGetObjects:range:)];
});
}
//=================================================================
// array set object at index
//=================================================================
#pragma mark - get object from array
- (void)avoidCrashSetObject:(id)obj atIndexedSubscript:(NSUInteger)idx {
@try {
[self avoidCrashSetObject:obj atIndexedSubscript:idx];
}
@catch (NSException *exception) {
[AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
}
@finally {
}
}
//=================================================================
// removeObjectAtIndex:
//=================================================================
#pragma mark - removeObjectAtIndex:
- (void)avoidCrashRemoveObjectAtIndex:(NSUInteger)index {
@try {
[self avoidCrashRemoveObjectAtIndex:index];
}
@catch (NSException *exception) {
[AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
}
@finally {
}
}
//=================================================================
// insertObject:atIndex:
//=================================================================
#pragma mark - set
- (void)avoidCrashInsertObject:(id)anObject atIndex:(NSUInteger)index {
@try {
[self avoidCrashInsertObject:anObject atIndex:index];
}
@catch (NSException *exception) {
[AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
}
@finally {
}
}
//=================================================================
// objectAtIndex:
//=================================================================
#pragma mark - objectAtIndex:
- (id)avoidCrashObjectAtIndex:(NSUInteger)index {
id object = nil;
@try {
object = [self avoidCrashObjectAtIndex:index];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
//=================================================================
// getObjects:range:
//=================================================================
#pragma mark - getObjects:range:
- (void)avoidCrashGetObjects:(__unsafe_unretained id _Nonnull *)objects range:(NSRange)range {
@try {
[self avoidCrashGetObjects:objects range:range];
} @catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
} @finally {
}
}
@end

View File

@ -0,0 +1,23 @@
//
// NSMutableAttributedString+AvoidCrash.h
// AvoidCrashDemo
//
// Created by mac on 16/10/15.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSMutableAttributedString (AvoidCrash)
+ (void)avoidCrashExchangeMethod;
@end
/**
* Can avoid crash method
*
* 1.- (instancetype)initWithString:(NSString *)str
* 2.- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs
*/

View File

@ -0,0 +1,74 @@
//
// NSMutableAttributedString+AvoidCrash.m
// AvoidCrashDemo
//
// Created by mac on 16/10/15.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "NSMutableAttributedString+AvoidCrash.h"
#import "AvoidCrash.h"
@implementation NSMutableAttributedString (AvoidCrash)
+ (void)avoidCrashExchangeMethod {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class NSConcreteMutableAttributedString = NSClassFromString(@"NSConcreteMutableAttributedString");
//initWithString:
[AvoidCrash exchangeInstanceMethod:NSConcreteMutableAttributedString method1Sel:@selector(initWithString:) method2Sel:@selector(avoidCrashInitWithString:)];
//initWithString:attributes:
[AvoidCrash exchangeInstanceMethod:NSConcreteMutableAttributedString method1Sel:@selector(initWithString:attributes:) method2Sel:@selector(avoidCrashInitWithString:attributes:)];
});
}
//=================================================================
// initWithString:
//=================================================================
#pragma mark - initWithString:
- (instancetype)avoidCrashInitWithString:(NSString *)str {
id object = nil;
@try {
object = [self avoidCrashInitWithString:str];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
//=================================================================
// initWithString:attributes:
//=================================================================
#pragma mark - initWithString:attributes:
- (instancetype)avoidCrashInitWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs {
id object = nil;
@try {
object = [self avoidCrashInitWithString:str attributes:attrs];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return object;
}
}
@end

View File

@ -0,0 +1,24 @@
//
// NSMutableDictionary+AvoidCrash.h
// AvoidCrash
//
// Created by mac on 16/9/22.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSMutableDictionary (AvoidCrash)
+ (void)avoidCrashExchangeMethod;
@end
/**
* Can avoid crash method
*
* 1. - (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey
* 2. - (void)removeObjectForKey:(id)aKey
*
*/

View File

@ -0,0 +1,72 @@
//
// NSMutableDictionary+AvoidCrash.m
// AvoidCrash
//
// Created by mac on 16/9/22.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "NSMutableDictionary+AvoidCrash.h"
#import "AvoidCrash.h"
@implementation NSMutableDictionary (AvoidCrash)
+ (void)avoidCrashExchangeMethod {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class dictionaryM = NSClassFromString(@"__NSDictionaryM");
//setObject:forKey:
[AvoidCrash exchangeInstanceMethod:dictionaryM method1Sel:@selector(setObject:forKey:) method2Sel:@selector(avoidCrashSetObject:forKey:)];
//removeObjectForKey:
Method removeObjectForKey = class_getInstanceMethod(dictionaryM, @selector(removeObjectForKey:));
Method avoidCrashRemoveObjectForKey = class_getInstanceMethod(dictionaryM, @selector(avoidCrashRemoveObjectForKey:));
method_exchangeImplementations(removeObjectForKey, avoidCrashRemoveObjectForKey);
});
}
//=================================================================
// setObject:forKey:
//=================================================================
#pragma mark - setObject:forKey:
- (void)avoidCrashSetObject:(id)anObject forKey:(id<NSCopying>)aKey {
@try {
[self avoidCrashSetObject:anObject forKey:aKey];
}
@catch (NSException *exception) {
[AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
}
@finally {
}
}
//=================================================================
// removeObjectForKey:
//=================================================================
#pragma mark - removeObjectForKey:
- (void)avoidCrashRemoveObjectForKey:(id)aKey {
@try {
[self avoidCrashRemoveObjectForKey:aKey];
}
@catch (NSException *exception) {
[AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
}
@finally {
}
}
@end

View File

@ -0,0 +1,29 @@
//
// NSMutableString+AvoidCrash.h
// AvoidCrashDemo
//
// Created by mac on 16/10/6.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSMutableString (AvoidCrash)
+ (void)avoidCrashExchangeMethod;
@end
/**
* Can avoid crash method
*
* 1. NSMutableString是继承于NSString,NSString有些同样的方法就不重复写了
* 2. - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString
* 3. - (void)insertString:(NSString *)aString atIndex:(NSUInteger)loc
* 4. - (void)deleteCharactersInRange:(NSRange)range
*
*/

View File

@ -0,0 +1,97 @@
//
// NSMutableString+AvoidCrash.m
// AvoidCrashDemo
//
// Created by mac on 16/10/6.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "NSMutableString+AvoidCrash.h"
#import "AvoidCrash.h"
@implementation NSMutableString (AvoidCrash)
+ (void)avoidCrashExchangeMethod {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class stringClass = NSClassFromString(@"__NSCFString");
//replaceCharactersInRange
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(replaceCharactersInRange:withString:) method2Sel:@selector(avoidCrashReplaceCharactersInRange:withString:)];
//insertString:atIndex:
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(insertString:atIndex:) method2Sel:@selector(avoidCrashInsertString:atIndex:)];
//deleteCharactersInRange
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(deleteCharactersInRange:) method2Sel:@selector(avoidCrashDeleteCharactersInRange:)];
});
}
//=================================================================
// replaceCharactersInRange
//=================================================================
#pragma mark - replaceCharactersInRange
- (void)avoidCrashReplaceCharactersInRange:(NSRange)range withString:(NSString *)aString {
@try {
[self avoidCrashReplaceCharactersInRange:range withString:aString];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
}
}
//=================================================================
// insertString:atIndex:
//=================================================================
#pragma mark - insertString:atIndex:
- (void)avoidCrashInsertString:(NSString *)aString atIndex:(NSUInteger)loc {
@try {
[self avoidCrashInsertString:aString atIndex:loc];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
}
}
//=================================================================
// deleteCharactersInRange
//=================================================================
#pragma mark - deleteCharactersInRange
- (void)avoidCrashDeleteCharactersInRange:(NSRange)range {
@try {
[self avoidCrashDeleteCharactersInRange:range];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
}
}
@end

View File

@ -0,0 +1,25 @@
//
// NSObject+AvoidCrash.h
// AvoidCrashDemo
//
// Created by mac on 16/10/11.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSObject (AvoidCrash)
+ (void)avoidCrashExchangeMethod;
@end
/**
* Can avoid crash method
*
* 1.- (void)setValue:(id)value forKey:(NSString *)key
* 2.- (void)setValue:(id)value forKeyPath:(NSString *)keyPath
* 3.- (void)setValue:(id)value forUndefinedKey:(NSString *)key //这个方法一般用来重写,不会主动调用
* 4.- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues
*
*/

View File

@ -0,0 +1,114 @@
//
// NSObject+AvoidCrash.m
// AvoidCrashDemo
//
// Created by mac on 16/10/11.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "NSObject+AvoidCrash.h"
#import "AvoidCrash.h"
@implementation NSObject (AvoidCrash)
+ (void)avoidCrashExchangeMethod {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
//setValue:forKey:
[AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forKey:) method2Sel:@selector(avoidCrashSetValue:forKey:)];
//setValue:forKeyPath:
[AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forKeyPath:) method2Sel:@selector(avoidCrashSetValue:forKeyPath:)];
//setValue:forUndefinedKey:
[AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forUndefinedKey:) method2Sel:@selector(avoidCrashSetValue:forUndefinedKey:)];
//setValuesForKeysWithDictionary:
[AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValuesForKeysWithDictionary:) method2Sel:@selector(avoidCrashSetValuesForKeysWithDictionary:)];
});
}
//=================================================================
// setValue:forKey:
//=================================================================
#pragma mark - setValue:forKey:
- (void)avoidCrashSetValue:(id)value forKey:(NSString *)key {
@try {
[self avoidCrashSetValue:value forKey:key];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
}
}
//=================================================================
// setValue:forKeyPath:
//=================================================================
#pragma mark - setValue:forKeyPath:
- (void)avoidCrashSetValue:(id)value forKeyPath:(NSString *)keyPath {
@try {
[self avoidCrashSetValue:value forKeyPath:keyPath];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
}
}
//=================================================================
// setValue:forUndefinedKey:
//=================================================================
#pragma mark - setValue:forUndefinedKey:
- (void)avoidCrashSetValue:(id)value forUndefinedKey:(NSString *)key {
@try {
[self avoidCrashSetValue:value forUndefinedKey:key];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
}
}
//=================================================================
// setValuesForKeysWithDictionary:
//=================================================================
#pragma mark - setValuesForKeysWithDictionary:
- (void)avoidCrashSetValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
@try {
[self avoidCrashSetValuesForKeysWithDictionary:keyedValues];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultIgnore;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
}
}
@end

View File

@ -0,0 +1,29 @@
//
// NSString+AvoidCrash.h
// AvoidCrashDemo
//
// Created by mac on 16/10/5.
// Copyright © 2016年 chenfanfang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (AvoidCrash)
+ (void)avoidCrashExchangeMethod;
@end
/**
* Can avoid crash method
*
* 1. - (unichar)characterAtIndex:(NSUInteger)index
* 2. - (NSString *)substringFromIndex:(NSUInteger)from
* 3. - (NSString *)substringToIndex:(NSUInteger)to {
* 4. - (NSString *)substringWithRange:(NSRange)range {
* 5. - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement
* 6. - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)options range:(NSRange)searchRange
* 7. - (NSString *)stringByReplacingCharactersInRange:(NSRange)range withString:(NSString *)replacement
*
*/

View File

@ -0,0 +1,204 @@
//
// NSString+AvoidCrash.m
// AvoidCrashDemo
//
// Created by mac on 16/10/5.
// Copyright © 2016 chenfanfang. All rights reserved.
//
#import "NSString+AvoidCrash.h"
#import "AvoidCrash.h"
@implementation NSString (AvoidCrash)
+ (void)avoidCrashExchangeMethod {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class stringClass = NSClassFromString(@"__NSCFConstantString");
//characterAtIndex
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(characterAtIndex:) method2Sel:@selector(avoidCrashCharacterAtIndex:)];
//substringFromIndex
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringFromIndex:) method2Sel:@selector(avoidCrashSubstringFromIndex:)];
//substringToIndex
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringToIndex:) method2Sel:@selector(avoidCrashSubstringToIndex:)];
//substringWithRange:
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringWithRange:) method2Sel:@selector(avoidCrashSubstringWithRange:)];
//stringByReplacingOccurrencesOfString:
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingOccurrencesOfString:withString:) method2Sel:@selector(avoidCrashStringByReplacingOccurrencesOfString:withString:)];
//stringByReplacingOccurrencesOfString:withString:options:range:
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingOccurrencesOfString:withString:options:range:) method2Sel:@selector(avoidCrashStringByReplacingOccurrencesOfString:withString:options:range:)];
//stringByReplacingCharactersInRange:withString:
[AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingCharactersInRange:withString:) method2Sel:@selector(avoidCrashStringByReplacingCharactersInRange:withString:)];
});
}
//=================================================================
// characterAtIndex:
//=================================================================
#pragma mark - characterAtIndex:
- (unichar)avoidCrashCharacterAtIndex:(NSUInteger)index {
unichar characteristic;
@try {
characteristic = [self avoidCrashCharacterAtIndex:index];
}
@catch (NSException *exception) {
NSString *defaultToDo = @"This framework default is to return a without assign unichar.";
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
}
@finally {
return characteristic;
}
}
//=================================================================
// substringFromIndex:
//=================================================================
#pragma mark - substringFromIndex:
- (NSString *)avoidCrashSubstringFromIndex:(NSUInteger)from {
NSString *subString = nil;
@try {
subString = [self avoidCrashSubstringFromIndex:from];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
subString = nil;
}
@finally {
return subString;
}
}
//=================================================================
// substringToIndex
//=================================================================
#pragma mark - substringToIndex
- (NSString *)avoidCrashSubstringToIndex:(NSUInteger)to {
NSString *subString = nil;
@try {
subString = [self avoidCrashSubstringToIndex:to];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
subString = nil;
}
@finally {
return subString;
}
}
//=================================================================
// substringWithRange:
//=================================================================
#pragma mark - substringWithRange:
- (NSString *)avoidCrashSubstringWithRange:(NSRange)range {
NSString *subString = nil;
@try {
subString = [self avoidCrashSubstringWithRange:range];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
subString = nil;
}
@finally {
return subString;
}
}
//=================================================================
// stringByReplacingOccurrencesOfString:
//=================================================================
#pragma mark - stringByReplacingOccurrencesOfString:
- (NSString *)avoidCrashStringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement {
NSString *newStr = nil;
@try {
newStr = [self avoidCrashStringByReplacingOccurrencesOfString:target withString:replacement];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
newStr = nil;
}
@finally {
return newStr;
}
}
//=================================================================
// stringByReplacingOccurrencesOfString:withString:options:range:
//=================================================================
#pragma mark - stringByReplacingOccurrencesOfString:withString:options:range:
- (NSString *)avoidCrashStringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)options range:(NSRange)searchRange {
NSString *newStr = nil;
@try {
newStr = [self avoidCrashStringByReplacingOccurrencesOfString:target withString:replacement options:options range:searchRange];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
newStr = nil;
}
@finally {
return newStr;
}
}
//=================================================================
// stringByReplacingCharactersInRange:withString:
//=================================================================
#pragma mark - stringByReplacingCharactersInRange:withString:
- (NSString *)avoidCrashStringByReplacingCharactersInRange:(NSRange)range withString:(NSString *)replacement {
NSString *newStr = nil;
@try {
newStr = [self avoidCrashStringByReplacingCharactersInRange:range withString:replacement];
}
@catch (NSException *exception) {
NSString *defaultToDo = AvoidCrashDefaultReturnNil;
[AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
newStr = nil;
}
@finally {
return newStr;
}
}
@end

View File

@ -70,7 +70,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<string>4</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
@ -407,6 +407,8 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>

View File

@ -50,6 +50,10 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi
if (!_topImage) {
_topImage = InitObject(UIImageView);
[_topImage setImage:IMAGEBYENAME(@"icons_con_topbg")];
if (self.deviceType==DEVICECAMERA)
{
[_topImage setImage:IMAGEBYENAME(@"apcoonetc")];
}
}
return _topImage;
}
@ -74,7 +78,7 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi
if (self.deviceType==DEVICECAMERA)
{
tip1=@"1.请长按摄像头背后复位孔,复位摄像头,复位后15秒内断电通电3次进入热点模式";
tip1=@"1.请长按摄像头背后复位孔,复位摄像头,进入热点模式";
tip2=@"2.点击去设置:设置-WiFi-选择GW-AP-xxx的网络一般无密码或12345678或查看说明书连接好后返回爱奇鱼app。";
}
NSArray*textArr=@[tip1,tip2];

View File

@ -644,6 +644,7 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔复位摄像
self.sBtn.hidden = YES;
self.nodImg.hidden = YES;
self.redTipLable.hidden=YES;
self.attentionLabel.hidden=YES;
}
-(void)wifiviewkeyboardWillHide:(NSNotification *)notify{