Professional Web Applications Themes

Cocoa: how do I coerce NS objects ? - Mac Programming

I'm sure this is mentioned somewhere but I don't see it. I have an NSCell which I know is an NSButtonCell. I'm sending an NSButtonCell message to it: [currentCell setAttributedTitle:attrStr]; and it obeys just fine but I get a compiler warning: warning: `NSCell' does not respond to `setAttributedTitle:' which annoys me since it's the only one I have. How do I make the warning go away in the neatest, most proper Cocoa manner ?...

  1. #1

    Default Cocoa: how do I coerce NS objects ?

    I'm sure this is mentioned somewhere but I don't see it.

    I have an NSCell which I know is an NSButtonCell.
    I'm sending an NSButtonCell message to it:

    [currentCell setAttributedTitle:attrStr];

    and it obeys just fine but I get a compiler warning:

    warning: `NSCell' does not respond to `setAttributedTitle:'

    which annoys me since it's the only one I have. How do I make
    the warning go away in the neatest, most proper Cocoa manner ?


    Simon Guest

  2. #2

    Default Re: Cocoa: how do I coerce NS objects ?

    dans l'article 0.1.2, Simon Slavin à
    demon.co.uklocalhost a écrit le 7/10/03 1:44:
     

    [(NSButtonCell *)currentCell setAttributedTitle:attrStr];

    Eric Guest

  3. #3

    Default Re: Cocoa: how do I coerce NS objects ?

    Eric VERGNAUD <fr> wrote:
     
    >
    > [(NSButtonCell *)currentCell setAttributedTitle:attrStr];[/ref]

    Right. The OP should note, though, that this an Objective-C matter, or
    even a C matter - it has nothing to do with Cocoa. m.

    --
    matt neuburg, phd = com, http://www.tidbits.com/matt/
    Read TidBITS! It's free and smart. http://www.tidbits.com
    matt Guest

  4. #4

    Default Re: Cocoa: how do I coerce NS objects ?

    In article <1g2f4kr.7krrkh114xxsaN%com>,
    com (matt neuburg) wrote:
     
    >
    >Right. The OP should note, though, that this an Objective-C matter, or
    >even a C matter - it has nothing to do with Cocoa.[/ref]

    Thanks to both of you.


    Simon Guest

Similar Threads

  1. Coerce ObjecyProxy to XML
    By BrentLamborn in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 15th, 03:56 PM
  2. #26265 [NEW]: zend_p_parameters() doesn't coerce overloaded objects into strings
    By adam at trachtenberg dot com in forum PHP Development
    Replies: 0
    Last Post: November 15th, 08:06 PM
  3. Visibility of Cocoa objects
    By Eric VERGNAUD in forum Mac Programming
    Replies: 6
    Last Post: September 13th, 07:34 PM
  4. Question about #coerce
    By Jim Cain in forum Ruby
    Replies: 2
    Last Post: July 9th, 02:09 PM
  5. Problem with coerce and SWIG
    By John Fletcher in forum Ruby
    Replies: 1
    Last Post: July 8th, 12:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139