-
Notifications
You must be signed in to change notification settings - Fork 6
/
MVMessage.m
38 lines (32 loc) · 872 Bytes
/
MVMessage.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#import "MVMessage.h"
#import "MVService.h"
@implementation MVMessage
@synthesize attributedString = attributedString_,
service = service_;
- (id)initWithAttributedString:(NSAttributedString*)attributedString
{
return [self initWithAttributedString:attributedString service:nil];
}
- (id)initWithAttributedString:(NSAttributedString*)attributedString
service:(NSObject<MVService>*)service
{
self = [super init];
if(self)
{
attributedString_ = attributedString;
service_ = service;
}
return self;
}
- (NSString*)description
{
NSString *desc;
if(self.service)
desc = [NSString stringWithFormat:@"%@ (%@)",
NSStringFromClass(self.service.class),
self.service.url];
else
desc = [NSString stringWithString:self.attributedString.string];
return desc;
}
@end