iPhone, Why am I getting a memory leak and how do i fix it?
<p>I must be getting a memory leak, I'm calling a graph library view and the view shows the first time I use this button method, but the second time the app crashes, with no real error message, that I can see.</p>

<pre><code>-(IBAction)graphNavButtonPressed
{   
    UIViewController *vc = [[GraphController alloc] init];

    [vc setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
    [self presentModalViewController:vc animated:YES];  // APP FAILS ON THIS LINE
    [vc release];
    return;
}

Program received signal:  “EXC_BAD_ACCESS”.
(gdb) bt
#0  0x02889903 in objc_msgSend ()
#1  0x0279a1c0 in __useVolatileDomainsForUser ()
#2  0x0267120c in CFPreferencesCopyAppValue ()
</code></pre>

<p>EDIT:</p>

<p>In GraphController ViewDidLoad I've got this code.</p>

<pre><code>NSUserDefaults *myDefaults = [NSUserDefaults standardUserDefaults];
strCurrencySymbol = [myDefaults objectForKey:kNSUCurrency]; //HERE where it crashes
</code></pre>

<p>EDIT 2:</p>

<p>Ive been reading about someone with a similar problem, caused by a view being loaded incorrectly. <a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/42772-nsuserdefaults-objc_msgsend.html" rel="nofollow">link text</a> I am doing something perhaps a little odd. In order to use the graph library from a tab bar, I load my date range view and then show the graph in viewDidLoad, then once the graph is closed the date range view remains. The user can then click view graph again to show the graph with different dates. If I don`t do this my view will be blank when the graph is closed. So heres how Im calling the graph.</p>

<p><img src="http://i.stack.imgur.com/1UyVb.jpg" alt="alt text"></p>

<p>I`m reusing the date range screen elsewhere so the graph may not be shown.</p>

<p>Any further suggestions ?</p>
