Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Creating a Color Meter Using Cocoa
Subject:   Problems with Color Meter
Date:   2001-07-19 14:02:22
From:   iansloman
I get the following messages when I build my code:
Controller.m(2 Warnings)
cannot find class (factory) method.
return type for 'colorWithCalibratedRED:green:blue:alpha' defaults to id


it is refering to the first line in - (void)updateColor
{
NSColor *aColour = [NSColor colorwithCalibratedRed:redValue green:greenValue blue:blueValue alpha:alphaValue];
[colourWell setColor:aColour];
}


Yes, I used a different spelling for colourWell and aColour, but I used the spelling consistently.


Thanks.
Ian

Full Threads Oldest First

Showing messages 1 through 5 of 5.

  • Problems with Color Meter
    2001-07-22 03:26:08  pengo98 [View]

    I got exactly the same two warning messages as you did at one stage. After some debugging, I found some typo in the colorWithCalibratedRed:green:blue:alpha: method. After correction, the program built successfully and ran without a hitch.

    Just my 2 cents.
    • Problems with Color Meter
      2001-07-23 11:38:02  iansloman [View]

      pengo98,

      Thanks very much. That was it. My code now compiles, However, when it runs, I get only an empty window. Do you have any ideas on what I might have missed? Thanks, again.

      Ian
      • Problems with Color Meter
        2001-07-23 17:31:05  pengo98 [View]

        Is is possible that you have accidentally deleted all the interface elements on the window?

        Open your nib file in Interface Builder and check your window. You can test the interface by choosing 'Test Interface' under the File menu.

        After you have made sure everything's right (don't forget to check the connections) , save it and run the program again in project builder.

        Hope this helps.




        • Thanks
          2001-07-24 09:18:37  iansloman [View]

          Thanks very much for the suggestion. My problem was that I had created another NIB file "Colour Meter.nib" and had put my window description there. I was able to delete the MainMenu.nib and rename the NIB file that I had created and it worked as described.

          Ian
  • Problems with Color Meter cont'd.
    2001-07-19 14:09:33  iansloman [View]

    I also found that when I tried to run it, all I got was a blank window.

    Thanks, again
    Ian