PDA

View Full Version : Problem in colorAT method




iphonejudy
Jun 15, 2009, 07:10 AM
I saw the below method in the document,It says it returns the color value of a particular pixel(x,y).But i got error that colorAtX is not declared.

Can anyone tell me the reason?


- (NSColor *)colorAtX:(NSInteger)x y:(NSInteger)y



robbieduncan
Jun 15, 2009, 07:28 AM
I saw the below method in the document,It says it returns the color value of a particular pixel(x,y).But i got error that colorAtX is not declared.

Can anyone tell me the reason?


- (NSColor *)colorAtX:(NSInteger)x y:(NSInteger)y

In which document? It's an instance method of a particular class: you have to call it on an instance of that class for it to work: you can't just type colorAtX:10 y:100 anywhere and have it work...

iphonejudy
Jun 15, 2009, 07:33 AM
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBitmapImageRep_Class/Reference/Reference.html#//apple_ref/occ/instm/NSBitmapImageRep/colorAtX:y:

Ivan P
Jun 15, 2009, 07:34 AM
iphonejudy strikes again, working on the first app made by every MR member :p

iphonejudy
Jun 15, 2009, 07:40 AM
What?

robbieduncan
Jun 15, 2009, 07:41 AM
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBitmapImageRep_Class/Reference/Reference.html#//apple_ref/occ/instm/NSBitmapImageRep/colorAtX:y:

So you have a valid NSBitmapImageRep object? Really? On an iPhone? I'm pretty sure UIImages don't work with NSBitmapImageReps.

Once again (and I know you've been told this before) ApplicationKit == Mac OSX. You can't use it on the iPhone. Please read the correct documentation instead of anything you find at random.

In all seriousness you seem to ask so many questions have you ever considered just getting someone qualified who knows what they are doing to do whatever it is you are trying to do: you are clearly miles out of your depth and never going to do this properly.

What?

I believe he is pointing out that we (that is MacRumors contributors) have written at least as much of this application as you have. If you ever complete this I hope you are going to share the profits.