EXC_BAD_ACCESS on NSString,when application is brought to foreground from background [ on 4.0 OS ]
<p>Currently My application is getting crashed on accessing NSString after bringing application to foreground from background [on 4.0 OS].</p>

<pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];

iDatabasePath  = [documentsDirectory stringByAppendingPathComponent:KApp_DB_Name]; 
</code></pre>

<p>iDatabasePath is declared as NSString* and it is globally declared. </p>

<p>When Application is moved to background and brought to foreground when I make a call to</p>

<pre><code> iDatabasePath  = [documentsDirectory stringByAppendingPathComponent:KApp_DB_Name]; 
</code></pre>

<p>Application crashes due to EXC_BAD_ACCESS to iDatabasePath and this is happening on 4.0 OS</p>

<p>Please help me on this.</p>

<p>Thanks,</p>

<p>Sagar</p>
