"'Objects' may not respond to 'functions'" warnings.
Posted
by
Andrew
on Stack Overflow
See other posts from Stack Overflow
or by Andrew
Published on 2011-01-11T16:32:31Z
Indexed on
2011/01/12
0:53 UTC
Read the original article
Hit count: 223
objective-c
|nscombobox
Hello all, for the last couple of weeks I've finally gotten into Obj-C from regular C and have started my first app. I've watched tutorials and read through a book along with a lot of webpages, but I know I've only just begun. Anyway, for most of the night and this morning, I've been trying to get this code to work, and now that it will compile, I have a few warnings. I've searched and found similar problems with solutions, but still no dice. What I'm trying to do is put an array made from a txt document into the popup list in a combo box.
AwesomeBoxList.h:
#import <Cocoa/Cocoa.h>
@interface AwesomeBoxList : NSObject
{
IBOutlet NSComboBox *ComboBoz;
}
-(NSArray *) getStringzFromTxtz;
- (void) awesomeBoxList;
@end
AwesomeBoxList.m:
#import "AwesomeBoxList.h"
@implementation AwesomeBoxList
-(NSArray *)getStringzFromTxtz
{
...
return combind;
}
- (void) awesomeBoxList
{
[ComboBoz setUsesDataSource:YES];
[ComboBoz setDataSource:
[ComboBoz getStringzFromTxtz]: //'NSComboBox' may not respond to 'getStringzFromTxtz'
[ComboBoz comboBox:(NSComboBox *)ComboBoz objectValueForItemAtIndex:
[ComboBoz numberOfItemsInComboBox:(NSComboBox *)ComboBoz]]];
/*'NSComboBox' may not respond to '-numberOfItemsInComboBox:'
'NSComboBox' may not respond to '-comboBox:objectValueForItemAtIndex:'
'NSComboBox' may not respond to '-setDataSource:'
*/
}
@end
So, with all of these errors and my still shallow knowledge of Obj-C, I must be making some sort of n00b mistake.
Thanks for the help.
© Stack Overflow or respective owner