按照如下方法修改代码即可
https://github.com/johnezang/JSONKit/pull/141/commits/ccc0565f0ae4a27371d18309ccb982a9f1f21b63
懒得改的可以直接clone我修改过的
https://github.com/klkucan/JSONKit
1 | #if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64 |
目前在8.0以后的推送需要以下几个步骤:
1.使用registerUserNotificationSettings: & registerForRemoteNotifications方法
1 | if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)]) { |
关于registerForRemoteNotifications方法有以下说明,它会需要实现两个delegate方法,并且方法能够被执行的条件是通过registerUserNotificationSettings:方法成功注册用户的notification,或者enabled for Background App Refresh。
// Calling this will result in either application:didRegisterForRemoteNotificationsWithDeviceToken: or application:didFailToRegisterForRemoteNotificationsWithError: to be called on the application delegate. Note: these callbacks will be made only if the application has successfully registered for user notifications with registerUserNotificationSettings:, or if it is enabled for Background App Refresh
2.实现delegate方法:每个APP都不同,就不写了。
创建plist文件及添加数值
数据读取,注意因为plist创建的时候可以选择dictionary或者array,这个也决定了后面怎么去读取它。
1 | NSString* filePath = [[NSBundle mainBundle] pathForResource:@"dict_data" ofType:@"plist"]; |
dispatch_async(queue, block);
参数中的queue可以通过dispatch_queue_create
或者系统提供的标准dispatch queue。1 | // 生成一个serial dispatch queue |
集合分为可变与不可变。
泛型,写法NSMutableArray<NSNumber*>* mutablearr = [NSMutableArray array];
和NSMutableDictionary<NSString*, NSNumber*>* dic = [[NSMutableDictionary alloc] init];
,目前会有warning提示如果类型不对。多参数泛型如下,第二行为Xcode的提示性代码。
1 | NSMutableDictionary<NSString*, NSNumber*>* dic = [[NSMutableDictionary alloc] init]; |
目前来看类型只能是Objective-C object或者block。
Update your browser to view this website correctly. Update my browser now