Hiding a Bar button item in the view
<p>How can you able to hide the (done) bar button item in a view? 
Basically, I have a view controller added with navigation bar (in IB) then, I also added a bar button item into the nav bar.
I just want initially the (done) bar button item is hidden.. when input is in the text view the (done) button is already visible.</p>

<p>Any idea on this implementation on a view controller? </p>

<p>Here's my sample code:</p>

<pre><code>@interface MyTextViewViewController : UIViewController &lt;UITextViewDelegate&gt; 
{
 UITextView *m_textView;
 UIBarButtonItem *doneBarButtonItem;   
}

@property(nonatomic,retain) IBOutlet UITextView *m_textView;
@property(nonatomic,retain) IBOutlet UIBarButtonItem *doneBarButtonItem;

- (IBAction)saveAction:(id)sender;
</code></pre>

<p>.m file:</p>

<pre><code>- (void)viewDidLoad {
    [super viewDidLoad];
    doneBarButtonItem.hidden = YES;   --&gt; compile error!!!
}

- (void)textViewDidBeginEditing:(UITextView *)textView
{ 
    doneBarButtonItem.hidden = NO;   --&gt; compile error!!!
}

- (IBAction)saveAction:(id)sender
{
    doneBarButtonItem.hidden = YES;   --&gt; compile error!!!
    ...
}
</code></pre>
