From ad97e8beaa8ef1dc18f3d12d9335a0008ef6d7a7 Mon Sep 17 00:00:00 2001 From: RbBtSn0w Date: Fri, 14 Mar 2014 14:39:35 +0800 Subject: [PATCH] =?UTF-8?q?1.=20Add=20macro=20for=20support=20iOS=206.=202?= =?UTF-8?q?.=20Fix=20about=20warning.=20Default=20property=20attribute=20?= =?UTF-8?q?=E2=80=98assign=E2=80=99=20not=20appropriate=20for=20non-GC=20o?= =?UTF-8?q?bject.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RTLabelProject/Classes/DemoTableViewController.m | 8 +++++++- RTLabelProject/Classes/RTLabel.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RTLabelProject/Classes/DemoTableViewController.m b/RTLabelProject/Classes/DemoTableViewController.m index ea1ad2d..16e5c48 100644 --- a/RTLabelProject/Classes/DemoTableViewController.m +++ b/RTLabelProject/Classes/DemoTableViewController.m @@ -39,6 +39,12 @@ #import "DemoTableViewCell.h" #import "RTLabel.h" +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0) +#define TextAlignmentCenter NSTextAlignmentCenter +#else +#define TextAlignmentCenter UITextAlignmentCenter +#endif + @implementation DemoTableViewController #pragma mark - @@ -57,7 +63,7 @@ - (id)initWithStyle:(UITableViewStyle)style [titleLabel setFont:[UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:20]]; [titleLabel setText:@"RTLabel"]; [self.navigationItem setTitleView:titleLabel]; - [titleLabel setTextAlignment:UITextAlignmentCenter]; + [titleLabel setTextAlignment:TextAlignmentCenter]; _dataArray = [NSMutableArray array]; NSMutableDictionary *row1 = [NSMutableDictionary dictionary]; diff --git a/RTLabelProject/Classes/RTLabel.h b/RTLabelProject/Classes/RTLabel.h index 3a5443b..cf3e887 100755 --- a/RTLabelProject/Classes/RTLabel.h +++ b/RTLabelProject/Classes/RTLabel.h @@ -63,7 +63,7 @@ typedef enum @property (nonatomic, assign) int componentIndex; @property (nonatomic, copy) NSString *text; @property (nonatomic, copy) NSString *tagLabel; -@property (nonatomic) NSMutableDictionary *attributes; +@property (nonatomic, strong) NSMutableDictionary *attributes; @property (nonatomic, assign) int position; - (id)initWithString:(NSString*)aText tag:(NSString*)aTagLabel attributes:(NSMutableDictionary*)theAttributes;