Inherits from TiProxy : NSObject
Declared in TiBlob.h

Overview

Blob object class.

Tasks

Properties

height

Returns height if the blob object is an image, 0 otherwise.

@property (nonatomic, readonly) NSInteger height

Declared In

TiBlob.h

length

Returns the data length.

@property (nonatomic, readonly) NSNumber *length

Declared In

TiBlob.h

size

Return the data size.

@property (nonatomic, readonly) NSInteger size

Discussion

For file, data returns the size in bytes, for image, returns the width x height.

Declared In

TiBlob.h

text

Return a textual representation of the blob.

@property (nonatomic, readonly) NSString *text

Discussion

The method converts data into a textual representation. Appropriate only for types TiBlobTypeFile and TiBlobTypeData.

Declared In

TiBlob.h

width

Returns width if the blob object is an image, 0 otherwise.

@property (nonatomic, readonly) NSInteger width

Declared In

TiBlob.h

Instance Methods

data

Returns the blob raw data.

- (NSData *)data

Return Value

The raw data.

Declared In

TiBlob.h

image

Returns the blob image.

- (UIImage *)image

Return Value

The image or nil if the blob data cannot represent an image.

Declared In

TiBlob.h

initWithData:mimetype:

Initialize the blob with data.

- (id)initWithData:(NSData *)data_ mimetype:(NSString *)mimetype_

Parameters

data_

The raw data.

mimetype_

The data mime type.

Declared In

TiBlob.h

initWithFile:

Initialize the blob with contents of a file.

- (id)initWithFile:(NSString *)path

Parameters

path

The path to the file.

Declared In

TiBlob.h

initWithImage:

Initialize the blob with an image.

- (id)initWithImage:(UIImage *)image

Parameters

image

The image

Declared In

TiBlob.h

mimeType

Returns the blob mime type.

- (NSString *)mimeType

Return Value

The mime type string.

Declared In

TiBlob.h

nativePath

Returns the blob native path (Android compatibility).

- (NSString *)nativePath

Return Value

The blob native path.

Declared In

TiBlob.h

path

Returns the blob file path.

- (NSString *)path

Return Value

The file path.

Declared In

TiBlob.h

setData:

Initialises blob with data.

- (void)setData:(NSData *)data

Parameters

data

Th data to set.

Declared In

TiBlob.h

setImage:

Initializes blob with image.

- (void)setImage:(UIImage *)image

Parameters

image

The image to set.

Declared In

TiBlob.h

setMimeType:type:

Sets the blob type.

- (void)setMimeType:(NSString *)mime type:(TiBlobType)type

Parameters

mime

The mime type string.

type

The blob type.

Declared In

TiBlob.h

type

Returns the blob type.

- (TiBlobType)type

Return Value

The blob type.

Declared In

TiBlob.h

writeTo:error:

Tells the blob to write its data to a file.

- (BOOL)writeTo:(NSString *)path error:(NSError **)error

Parameters

path

The file path.

error

The error result if failed.

Return Value

YES if the write operation succeeded, NO otherwise.

Declared In

TiBlob.h