Error during insert binary data in Ultralite database iPhone
<p>Hi I am writing a iphone application where I need to store binary data i.e.; image in the Ultralite database.
I am using following code for this purpose.</p>

<pre><code>NSString *filePath = [[NSBundle mainBundle] pathForResource:@"file_name" ofType:@"png"];
NSData *data = [NSData dataWithContentsOfFile:filePath];
NSUInteger len = [data length];
ul_binary *byteData = (ul_binary*)malloc(len);
memcpy(byteData, [data bytes], len);

ULTable *table = connection-&gt;OpenTable("NAMES");
if(table-&gt;InsertBegin()){
    table-&gt;SetInt(1, (maxId+1));
    table-&gt;SetString(2, [name UTF8String]);
    table-&gt;SetBinary(3, byteData);
    table-&gt;Insert();
    table-&gt;Close();
    connection-&gt;Commit();
}
</code></pre>

<p>This code is giving error 'EXC_BAD_ERROR' on line:: </p>

<pre><code>table-&gt;SetBinary(3, byteData);
</code></pre>

<p>This code works fine if i comment this line.</p>

<p>Any help would be appreciated!
Thanks</p>
