Last active
January 14, 2017 03:18
-
-
Save Raztor0/7c7492316ddb32e09d143ec2b9c320d0 to your computer and use it in GitHub Desktop.
This file contains 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
@interface SomeClass : NSObject | |
@property (nonatomic, strong) NSString *someProperty; | |
@end | |
@implementation SomeClass | |
+ (void)load { | |
[self new]; | |
} | |
- (instancetype)init { | |
self = [super init]; | |
if (self) { | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul), ^{ | |
NSLog(@"%@", [NSThread currentThread]); | |
while (true) { | |
@autoreleasepool { | |
self.someProperty = [[NSProcessInfo processInfo] globallyUniqueString]; | |
} | |
} | |
}); | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul), ^{ | |
NSLog(@"%@", [NSThread currentThread]); | |
while (true) { | |
@autoreleasepool { | |
NSString __unused *something = [self getPropertyOrHoopla]; | |
} | |
} | |
}); | |
} | |
return self; | |
} | |
- (NSString *)getPropertyOrHoopla { | |
return self.someProperty ?: @"hoopla"; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment