IOS代码片段

时间:2023-03-09 13:15:14
IOS代码片段

2017-08-03

获取应用程序委托
FKAppDelegate* appDelegate = [UIApplication shareApplication].delegate

2017-08-03

(__bridge CFMutableStringRef)

2017-08-20

    NSBundle *buddle = [NSBundle bundleWithPath:@"你的bundle文件存放路径"];
[buddle load];//这一步必须执行,否则buddle无效

2018-05-06

[self.navigationController popToRootViewControllerAnimated:YES];跳转到最顶层。

2018-09-05

过期限制访问代码。

NSInteger* _cbId = [paramDict integerValueForKey:@"cbId" defaultValue:];

    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:@"2018-09-06 9:50:00"];
NSDate *now = [NSDate date];
NSComparisonResult result3 = [date compare:now];
if(result3==NSOrderedAscending){
if (_cbId > ) {
NSDictionary *ret = @{@"code":@(-), @"msg":@"模块过期"};
[self sendResultEventWithCallbackId:_cbId dataDict:ret errDict:nil doDelete:YES];
}
return;
}