2012-11-13 32 views
0

一個類的方法我有這樣的代碼,我想調用這個類方法來獲取一個ImageView的一些參數,但我不知道該怎麼稱呼它,你能幫幫我嗎?徵集的NSArray

+ (NSArray*)getRGBAsFromImage:(UIImage*)image atX:(int)xx andY:(int)yy count:(int)count 
+0

我不明白,你想要做什麼? – jimpic

+0

你說的「如何叫它」是什麼意思?難道你不知道的語法? – 2012-11-13 10:25:06

回答

0

您可以使用您的班級名稱調用該方法。

如果你的類是這樣的:

@interface myClass 

+ (NSArray*)getRGBAsFromImage:(UIImage*)image atX:(int)xx andY:(int)yy count:(int)count 

@end 

,你可以調用此方法,如:

NSArray *temp = [myClass getRGBAsFromImage:yourImage atX:x andY:y count:count]; 
0

要叫它你只需要使用類名...

如果這是在UIImage然後...

[UIImage getRGBAsFromImage:someImage atX:xVal andY:yVal count:countVal];