Skip to content

Instantly share code, notes, and snippets.

@mlaster
Created September 1, 2013 15:46
Show Gist options
  • Save mlaster/6405290 to your computer and use it in GitHub Desktop.
Save mlaster/6405290 to your computer and use it in GitHub Desktop.
- (void)testWeak { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" NSString *strong = @"foo"; __weak NSString *weak = strong; NSLog(@"weak: %@", weak); strong = nil; NSLog(@"weak: %@", weak); #pragma clang diagnostic pop }
- (void)testWeak {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak"
NSString *strong = @"foo";
__weak NSString *weak = strong;
NSLog(@"weak: %@", weak);
strong = nil;
NSLog(@"weak: %@", weak);
#pragma clang diagnostic pop
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment