• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to enable/disable a UITextField or UITextView programmatically?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to enable/disable a UITextField or UITextView programmatically?


  • Subject: Re: How to enable/disable a UITextField or UITextView programmatically?
  • From: "Henry McGilton (Boulevardier)" <email@hidden>
  • Date: Wed, 13 Jan 2010 18:39:49 -0800

On Jan 13, 2010, at 6:22 PM, William Squires wrote:

> I have a UITableView that's part of a Navigation-based Application. There's one .xib, a DrinkDetailViewController class (.m & .h files) and an AddDrinkViewController class which inherits from DrinkDetailViewController. Both share the same view, which contains a UITextField, two UITextViews, and some UILabels. The DrinkDetailViewController.h declares three IBOutlets as follows:
>
> #import <UIKit/UIKit.h>
>
> @interface DrinkDetailViewController : UIViewController
> {
> IBOutlet UITextField *nameField;
> IBOutlet UITextView *ingredientsView;
> IBOutlet UITextView *directionsView;
> ...
> }
>
> @end
>
> so that I can access the UITextField, and the two UITextViews. IB shows in the inspector window, that the UITextField, and UITextViews have a BOOL enabled property (controlled by a checkbox labeled "Enabled"). But the following doesn't work:
>
> ...
> nameField.enabled = YES;
> ingredientsView.enabled = YES;
> directionsView.enabled = YES;
> ...
>
> in the viewDidLoad: method of AddDrinkViewController. I unchecked the enabled box for these controls as the normal use of the view is just to display drink information, not for data entry. The AddDrinkViewController re-uses the view for data entry, and I want to re-enable the fields, but only when the view (xib) is used/loaded by the AddDrinkViewController. I looked in the docs for UITextField, but didn't even see a reference to an enabled property. Is this another of those view-within-a-view problems?

The    enabled    property is defined in UIControl --- the super-class of UITextField . . .

This is a good time for a plug for Xcode's incredibly useful but oft skipped over Class Browser,
the second item in Xcode's  Project  menu . . .

    Cheers,
        . . . . . . . .    Henry



=================================================
iPhone App Development and Developer Education . . .
        Visit  www.nonatomic-retain.com

Mac OSX Application Development, Plus a Great Deal More . . .
        Visit  www.trilithon.com

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How to enable/disable a UITextField or UITextView programmatically? (From: William Squires <email@hidden>)

  • Prev by Date: How to enable/disable a UITextField or UITextView programmatically?
  • Next by Date: Re: Snapshotting hidden UIViews
  • Previous by thread: How to enable/disable a UITextField or UITextView programmatically?
  • Next by thread: setting a preference pane anchor name
  • Index(es):
    • Date
    • Thread