mattt/TTTAttributedLabel — Issue #33: Get compile errors with strong setting for compiler warnings
Author: AndrewSmall
Created: 2011-12-09 22:23:31+00:00
State: open

I put together a patch for this. Thanks!

From ff7cc1ecffe7722a6b37f8af1a418b3edc1711e5 Mon Sep 17 00:00:00 2001
From: Andrew Small
Date: Fri, 9 Dec 2011 16:02:46 -0600
Subject: [PATCH] Fixed compile errors from stronger compile options.

---
TTTAttributedLabel.m | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/TTTAttributedLabel.m b/TTTAttributedLabel.m
index 0b327d6..da692ba 100644
--- a/TTTAttributedLabel.m
+++ b/TTTAttributedLabel.m
@@ -132,6 +132,7 @@ static inline NSAttributedString * NSAttributedStringByScalingFontSize(NSAttribu
- (NSTextCheckingResult *)linkAtPoint:(CGPoint)p;
- (NSUInteger)characterIndexAtPoint:(CGPoint)p;
- (void)drawFramesetter:(CTFramesetterRef)framesetter textRange:(CFRange)textRange inRect:(CGRect)rect context:(CGContextRef)c;
+- (void)handleTap:(UITapGestureRecognizer *)gestureRecognizer;
@end

@implementation TTTAttributedLabel
@@ -301,7 +302,7 @@ static inline NSAttributedString * NSAttributedStringByScalingFontSize(NSAttribu
- (NSTextCheckingResult *)linkAtCharacterIndex:(CFIndex)idx {
for (NSTextCheckingResult *result in self.links) {
NSRange range = result.range;
- if (range.location <= idx && idx <= range.location + range.length) {
+ if ((CFIndex)range.location <= idx && idx <= (CFIndex)(range.location + range.length)) {
return result;
}
}
--
1.7.5.4