NSMutableData(PSDAdditions) Category Reference
Declared in | NSDataPSDAdditions.h NSDataPSDAdditions.m |
Tasks
-
– appendValue:withLength:
Allows you to append a numeric value to an NSMutableData object and pad it to any length.
Instance Methods
appendValue:withLength:
Allows you to append a numeric value to an NSMutableData object and pad it to any length.
- (void)appendValue:(long)value withLength:(int)length
Parameters
- length:
The number of bytes that should be used to store the value. The value will be padded to length bytes regardless of the number of bytes required to store it.
- value:
The value to append
Discussion
Allows you to append a numeric value to an NSMutableData object and pad it to any length.
For example, we could say [data appendValue: 2 withLength: 5], and 00002 would be written into the data object. Very useful for writing to file formats that have header structures that require a certain number of bytes be used for a certain value. i.e. PSD and TIFF
Declared In
NSDataPSDAdditions.h