Navigation error crash in pageload
<p>I am doing a reader app, which can sync text to google doc ,i got a sample project and i implement it in my reader application every thing works fine ,but my problem is: i have a googledoc button in my reader app,when the user clicks it it navigate to a page which contains login button and upload button,but the upload button is disabled only the user logins successfully then after it is enabled.So login button is tapped it navigate to the authentication(login page)after successful login it page atomatically navigated to the loin button page and upload button enables,here is the problem i am facing after come back tot he upload page it crashes the application.but the sample project works fine.Only diffrence is the sample project have a navigation bar and in my app there in no navigation bar.ishwoed both the codes ,if i have any error done please help e to solve this.
this is my sample project code:</p>

<pre><code>#import "PasswordViewController.h"
#import "PasswordView.h"

@interface PasswordViewController ()

@property (nonatomic, retain) NSString *status;

- (IBAction)cancel:(id)sender;
- (IBAction)setAccount:(id)sender;

@end

@implementation PasswordViewController

@dynamic status;
@synthesize username = m_username,
            password = m_password
            ;
@dynamic isAccountVerified;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil delegate:(NSObject &lt;PasswordDelegate&gt; *)delegate
{
    if (self == [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
    {
        // Custom initialization
        self.username = @"";
        self.password = @"";

        m_status = @"";
        m_delegate = delegate;

        UIBarButtonItem *buttonT = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel  target:self action:@selector(cancel:)];
        self.navigationItem.leftBarButtonItem = buttonT;
        [buttonT release];

        buttonT = [[UIBarButtonItem alloc] initWithTitle:@"Set" style:UIBarButtonItemStyleBordered  target:self action:@selector(setAccount:)];
        self.navigationItem.rightBarButtonItem = buttonT;
        [buttonT release];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    m_fViewLoaded = YES;

    PasswordView *passwordview = (PasswordView *)self.view;
    passwordview.textfieldUsername.text = self.username;
    passwordview.textfieldUsername.delegate = self;
    passwordview.textfieldPassword.text = self.password;
    passwordview.textfieldPassword.delegate = self;
    passwordview.labelStatus.text = m_status;
    passwordview.labelErrorMsg.text = @"";
    passwordview.spinner.hidden = YES;
}

- (void)dealloc
{
    [super dealloc];
}

#pragma mark Actions

- (IBAction)cancel:(id)sender
{
    [m_delegate cancelSetPassword:self];
}

- (IBAction)setAccount:(id)sender
{
    m_status = @"Verifying account…";

    Assert(m_fViewLoaded);
    if (m_fViewLoaded)
    {
        PasswordView *passwordview = (PasswordView *)self.view;
        passwordview.spinner.hidden = NO;
        [passwordview.spinner startAnimating];

        self.username = passwordview.textfieldUsername.text;
        self.password = passwordview.textfieldPassword.text;
        [m_delegate verifyAccount:self username:self.username password:self.password];
    }
}

#pragma mark Properties

- (BOOL)isAccountVerified
{
    return m_fAccountVerified;
}

- (void)setIsAccountVerified:(BOOL)fVerified
{
    m_fAccountVerified = fVerified;
    self.status = [NSString stringWithFormat:@"Account login %@.", m_fAccountVerified ? @"succeeded" : @"failed"];

    if (m_fViewLoaded)
    {
        PasswordView *passwordview = (PasswordView *)self.view;
        [passwordview.spinner stopAnimating];
        passwordview.spinner.hidden = YES;
    }

    if (fVerified)
        [m_delegate setAccount:self username:self.username password:self.password];
}

- (NSString *)status
{
    return m_status;
}

- (void)setStatus:(NSString *)status
{
    if (m_status != status)
        [m_status release];
    m_status = [status retain];

    if (m_fViewLoaded)
    {
        PasswordView *passwordview = (PasswordView *)self.view;
        passwordview.labelStatus.text = m_status;
    }
}

- (void)setError:(NSError *)error
{
    if (m_fViewLoaded)
    {
        PasswordView *passwordview = (PasswordView *)self.view;

        passwordview.labelErrorMsg.text = error == nil
            ? @""
            : [NSString stringWithFormat:@"%@ (%d)", [error.userInfo objectForKey:@"error"], error.code];
    }
}
</code></pre>

<p>and this is my project code for the same page</p>

<pre><code>#import "PasswordViewController.h"
#import "PasswordView.h"
#import "Googledocmainpage.h"

@interface PasswordViewController ()

@property (nonatomic, retain) NSString *status;

- (IBAction)cancel:(id)sender;
- (IBAction)setAccount:(id)sender;

@end

@implementation PasswordViewController

@dynamic status;
@synthesize username = m_username,
            password = m_password
            ;
@dynamic isAccountVerified;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil delegate:(NSObject &lt;PasswordDelegate&gt; *)delegate
{
    if (self == [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
    {
        // Custom initialization
        self.username = @"";
        self.password = @"";

        m_status = @"";
        m_delegate = delegate;

        UIBarButtonItem *buttonT = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel  target:self action:@selector(cancel:)];
        self.navigationItem.leftBarButtonItem = buttonT;
        [buttonT release];

        buttonT = [[UIBarButtonItem alloc] initWithTitle:@"Set" style:UIBarButtonItemStyleBordered  target:self action:@selector(setAccount:)];
        self.navigationItem.rightBarButtonItem = buttonT;
        [buttonT release];    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    m_fViewLoaded = YES;

    PasswordView *passwordview = (PasswordView *)self.view;
    passwordview.textfieldUsername.text = self.username;
    passwordview.textfieldUsername.delegate = self;
    passwordview.textfieldPassword.text = self.password;
    passwordview.textfieldPassword.delegate = self;
    passwordview.labelStatus.text = m_status;
    passwordview.labelErrorMsg.text = @"";
    passwordview.spinner.hidden = YES;
}
-(IBAction)_clikcGooglebtnclose:(id)sender
{
   [m_delegate cancelSetPassword:self]; 
    [self dismissModalViewControllerAnimated:YES];
}
- (void)dealloc
{
    [super dealloc];
}

#pragma mark Actions

- (IBAction)cancel:(id)sender
{
    [m_delegate cancelSetPassword:self];
}

- (IBAction)setAccount:(id)sender
{
    m_status = @"Verifying account…";

    Assert(m_fViewLoaded);
    if (m_fViewLoaded)
    {
        PasswordView *passwordview = (PasswordView *)self.view;
        passwordview.spinner.hidden = NO;
        [passwordview.spinner startAnimating];

        self.username = passwordview.textfieldUsername.text;
        self.password = passwordview.textfieldPassword.text;
        [m_delegate verifyAccount:self username:self.username password:self.password];


    }
}

#pragma mark Properties

- (BOOL)isAccountVerified
{
    return m_fAccountVerified;



}

- (void)setIsAccountVerified:(BOOL)fVerified
{
    m_fAccountVerified = fVerified;
    self.status = [NSString stringWithFormat:@"Account login %@.", m_fAccountVerified ? @"succeeded" : @"failed"];

    if (m_fViewLoaded)
    {
        PasswordView *passwordview = (PasswordView *)self.view;
        [passwordview.spinner stopAnimating];
        passwordview.spinner.hidden = YES;

    }

    if (fVerified)
        [m_delegate setAccount:self username:self.username password:self.password];
     // [self dismissModalViewControllerAnimated:YES];


}

- (NSString *)status
{
    return m_status;
}

- (void)setStatus:(NSString *)status
{
    if (m_status != status)
        [m_status release];
    m_status = [status retain];

    if (m_fViewLoaded)
    {
        PasswordView *passwordview = (PasswordView *)self.view;
        passwordview.labelStatus.text = m_status;
    }
}

- (void)setError:(NSError *)error
{
    if (m_fViewLoaded)
    {
        PasswordView *passwordview = (PasswordView *)self.view;

        passwordview.labelErrorMsg.text = error == nil
            ? @""
            : [NSString stringWithFormat:@"%@ (%d)", [error.userInfo objectForKey:@"error"], error.code];
    }
}
</code></pre>
