• 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: setString question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setString question...


  • Subject: Re: setString question...
  • From: "I. Savant" <email@hidden>
  • Date: Mon, 5 Feb 2007 14:12:01 -0500


On Feb 5, 2007, at 1:57 PM, Ricky Sharp wrote:
Typically, you can get nice compiler warnings about this (e.g. 'textField may not respond to setString:') My guess is that you declared textField as an id (which is a perfectly valid thing to do), instead of the more specific type of NSTextField*.

A good point. If you've created an outlet for Interface Builder, for instance, you may have done this:


IBOutlet id textField;

  Ricky is suggesting you should instead do this:

IBOutlet NSTextField * textField;

That way, if you send "-setString:" to textField, you'll get a compiler warning (that textField may not respond to -setString:) since it knows textField is supposed to be an NSTextField.

--
I.S.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >setString question... (From: email@hidden)
 >Re: setString question... (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: setString question...
  • Next by Date: What needs to be done to have a Draggable NSTextCellAttachment
  • Previous by thread: AppKiDo (was: setString question...)
  • Next by thread: What needs to be done to have a Draggable NSTextCellAttachment
  • Index(es):
    • Date
    • Thread