Skip to content

Commit

Permalink
Fix NSAutoreleaseNoPool warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
0xced committed Aug 5, 2010
1 parent c5cded2 commit 2692594
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.m
Expand Up @@ -16,12 +16,13 @@ CGFloat UIScreen_scale(id self, SEL _cmd)

int main(int argc, char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

// -[UIView alpha] has the same method signature as -[UIScreen scale]
Method alpha = class_getInstanceMethod([UIView class], @selector(alpha));
if (![UIScreen instancesRespondToSelector:@selector(scale)])
class_addMethod([UIScreen class], @selector(scale), (IMP)UIScreen_scale, method_getTypeEncoding(alpha));

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
Expand Down

0 comments on commit 2692594

Please sign in to comment.