Created
August 27, 2013 10:48
-
-
Save odrobnik/6352084 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
- (void)viewDidLayoutSubviews | |
{ | |
[super viewDidLayoutSubviews]; | |
CGFloat topInset = 0; | |
CGFloat bottomInset = 0; | |
if ([self respondsToSelector:NSSelectorFromString(@"topLayoutGuide")]) | |
{ | |
id topLayoutGuide = [self valueForKeyPath:@"topLayoutGuide"]; | |
topInset = (CGFloat)[topLayoutGuide length]; // 97 | |
} | |
topInset = [self.topLayoutGuide length]; // 64 | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since
topLayoutGuide
is typed asid
, the return type of thelength
message is guessed to beNSUInteger
and the message is sent with the wrong ABI calling convention.Try using your
topLayoutGuide
object actual class instead of casting the result toCGFloat
, i.e.