File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ typedef enum _NSBubbleType
21
21
22
22
@interface NSBubbleData : NSObject
23
23
24
- @property (nonatomic , strong ) NSDate *date;
25
- @property (nonatomic ) NSBubbleType type;
26
- @property (nonatomic , strong ) NSString *text;
24
+ @property (readonly , nonatomic , strong ) NSDate *date;
25
+ @property (readonly , nonatomic ) NSBubbleType type;
26
+ @property (readonly , nonatomic , strong ) NSString *text;
27
27
28
28
- (id )initWithText : (NSString *)text andDate : (NSDate *)date andType : (NSBubbleType)type ;
29
29
+ (id )dataWithText : (NSString *)text andDate : (NSDate *)date andType : (NSBubbleType)type ;
Original file line number Diff line number Diff line change @@ -29,9 +29,11 @@ - (id)initWithText:(NSString *)initText andDate:(NSDate *)initDate andType:(NSBu
29
29
self = [super init ];
30
30
if (self)
31
31
{
32
- self.text = initText;
33
- self.date = initDate;
34
- self.type = initType;
32
+ text = initText;
33
+ if (!text || [text isEqualToString: @" " ]) text = @" " ;
34
+
35
+ date = initDate;
36
+ type = initType;
35
37
}
36
38
return self;
37
39
}
Original file line number Diff line number Diff line change @@ -76,7 +76,13 @@ - (void)reloadData
76
76
for (NSString *key in [bubbleDictionary allKeys ])
77
77
{
78
78
NSMutableArray *array = [bubbleDictionary valueForKey: key];
79
- for (NSObject *object in array) [object release ];
79
+ for (NSObject *object in array)
80
+ {
81
+ NSBubbleDataInternal *dataInternal = (NSBubbleDataInternal *)object;
82
+
83
+ [dataInternal.data release ];
84
+ [dataInternal release ];
85
+ }
80
86
[array release ];
81
87
}
82
88
[bubbleDictionary release ];
@@ -119,7 +125,7 @@ - (void)reloadData
119
125
dataInternal.data = (NSBubbleData *)[bubbleData objectAtIndex: i];
120
126
121
127
// Calculating cell height
122
- dataInternal.labelSize = [dataInternal.data.text sizeWithFont: [UIFont systemFontOfSize: [UIFont systemFontSize ]] constrainedToSize: CGSizeMake (220 , 9999 ) lineBreakMode: UILineBreakModeWordWrap];
128
+ dataInternal.labelSize = [( dataInternal.data.text ? dataInternal.data.text : @" " ) sizeWithFont: [UIFont systemFontOfSize: [UIFont systemFontSize ]] constrainedToSize: CGSizeMake (220 , 9999 ) lineBreakMode: UILineBreakModeWordWrap];
123
129
124
130
dataInternal.height = dataInternal.labelSize .height + 5 + 11 ;
125
131
You can’t perform that action at this time.
0 commit comments