|
@@ -10,6 +10,7 @@
|
|
|
#import "MKRPlayControlViewController.h"
|
|
|
#import <MKRRadioManager/MKRAVPlayer.h>
|
|
|
#import <YYCategory/NSString+Utilities.h>
|
|
|
+#import <NSHashTable+MKRRadioManagerAdd.h>
|
|
|
|
|
|
@interface MKRViewController ()
|
|
|
|
|
@@ -19,6 +20,8 @@
|
|
|
|
|
|
@property (nonatomic, strong) MKRAVPlayer *player;
|
|
|
|
|
|
+@property (nonatomic, strong) NSHashTable *hashTable;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation MKRViewController
|
|
@@ -32,11 +35,19 @@
|
|
|
[_MKRWIFIDeviceManager searchDeviceWithSearchTime:20 timeBlock:^(NSInteger time) {
|
|
|
[self.tableView reloadData];
|
|
|
}];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)viewDidLoad
|
|
|
{
|
|
|
[super viewDidLoad];
|
|
|
+
|
|
|
+ [self.hashTable addObject:self];
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
|
|
+ for (NSInteger i = 0; i<10; i++) {
|
|
|
+ [self.hashTable makeObjectsPerformSelectorWithObjectsOnMainThread:@selector(testMethod)];
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
@@ -56,6 +67,10 @@
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
}
|
|
|
|
|
|
+- (void)testMethod{
|
|
|
+ MKRLog(@"测试方法");
|
|
|
+}
|
|
|
+
|
|
|
- (NSMutableArray *)dataSource {
|
|
|
if (!_dataSource) {
|
|
|
_dataSource = [NSMutableArray array];
|
|
@@ -63,4 +78,11 @@
|
|
|
return _dataSource;
|
|
|
}
|
|
|
|
|
|
+- (NSHashTable *)hashTable{
|
|
|
+ if (!_hashTable) {
|
|
|
+ _hashTable = [NSHashTable weakObjectsHashTable];
|
|
|
+ }
|
|
|
+ return _hashTable;
|
|
|
+}
|
|
|
+
|
|
|
@end
|