Change attachmentData property of BITCrashAttachment to crashAttachmentData

This commit is contained in:
Andreas Linde 2014-04-29 13:46:01 +02:00
parent 01eef668d1
commit 75263f64fc
4 changed files with 8 additions and 8 deletions

View File

@ -43,7 +43,7 @@
/** /**
* The attachment data as NSData object * The attachment data as NSData object
*/ */
@property (nonatomic, readonly, strong) NSData *attachmentData; @property (nonatomic, readonly, strong) NSData *crashAttachmentData;
/** /**
* The content type of your data as MIME type * The content type of your data as MIME type
@ -60,7 +60,7 @@
* @return An instsance of BITCrashAttachment * @return An instsance of BITCrashAttachment
*/ */
- (instancetype)initWithFilename:(NSString *)filename - (instancetype)initWithFilename:(NSString *)filename
attachmentData:(NSData *)attachmentData crashAttachmentData:(NSData *)crashAttachmentData
contentType:(NSString *)contentType; contentType:(NSString *)contentType;
@end @end

View File

@ -31,12 +31,12 @@
@implementation BITCrashAttachment @implementation BITCrashAttachment
- (instancetype)initWithFilename:(NSString *)filename - (instancetype)initWithFilename:(NSString *)filename
attachmentData:(NSData *)attachmentData crashAttachmentData:(NSData *)crashAttachmentData
contentType:(NSString *)contentType contentType:(NSString *)contentType
{ {
if (self = [super init]) { if (self = [super init]) {
_filename = filename; _filename = filename;
_attachmentData = attachmentData; _crashAttachmentData = crashAttachmentData;
_contentType = contentType; _contentType = contentType;
} }
@ -48,14 +48,14 @@
- (void)encodeWithCoder:(NSCoder *)encoder { - (void)encodeWithCoder:(NSCoder *)encoder {
[encoder encodeObject:self.filename forKey:@"filename"]; [encoder encodeObject:self.filename forKey:@"filename"];
[encoder encodeObject:self.attachmentData forKey:@"data"]; [encoder encodeObject:self.crashAttachmentData forKey:@"data"];
[encoder encodeObject:self.contentType forKey:@"contentType"]; [encoder encodeObject:self.contentType forKey:@"contentType"];
} }
- (id)initWithCoder:(NSCoder *)decoder { - (id)initWithCoder:(NSCoder *)decoder {
if ((self = [super init])) { if ((self = [super init])) {
_filename = [decoder decodeObjectForKey:@"filename"]; _filename = [decoder decodeObjectForKey:@"filename"];
_attachmentData = [decoder decodeObjectForKey:@"data"]; _crashAttachmentData = [decoder decodeObjectForKey:@"data"];
_contentType = [decoder decodeObjectForKey:@"contentType"]; _contentType = [decoder decodeObjectForKey:@"contentType"];
} }
return self; return self;

View File

@ -1005,7 +1005,7 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
BITCrashAttachment *attachment = (BITCrashAttachment *)dict[KBITAttachmentDictAttachment]; BITCrashAttachment *attachment = (BITCrashAttachment *)dict[KBITAttachmentDictAttachment];
[postBody appendData:[BITHockeyAppClient dataWithPostValue:attachment.attachmentData [postBody appendData:[BITHockeyAppClient dataWithPostValue:attachment.crashAttachmentData
forKey:key forKey:key
contentType:attachment.contentType contentType:attachment.contentType
boundary:boundary boundary:boundary

View File

@ -66,7 +66,7 @@
NSData *data = [NSData dataWithContentsOfURL:@"mydatafile"]; NSData *data = [NSData dataWithContentsOfURL:@"mydatafile"];
BITCrashAttachment *attachment = [[BITCrashAttachment alloc] initWithFilename:@"myfile.data" BITCrashAttachment *attachment = [[BITCrashAttachment alloc] initWithFilename:@"myfile.data"
attachmentData:data crashAttachmentData:data
contentType:@"'application/octet-stream"]; contentType:@"'application/octet-stream"];
return attachment; return attachment;
} }