I must be asleep already or something because I’m seeing weird things.
I’ve got a class, called ListSorter (.h/.m), which has 2 extern methods.
The .h looks like:
@interface ListSorter : NSObject {
BOOL eersteKeer;
Menu_Versie_DrieAppDelegate *appDelegate;
}
-(void)convertList;
-(void)addItemToAlertList:item;
-(void)addItemToHistoryList:item;
In an other class, I’ve imported ListSorter.h in the .h-file, and made an instance of it:
#import "ListSorter.h"
@class ListSorter;
@interface CloseIncController : UIViewController {
ListSorter *sorter;
}
@property (nonatomic, retain) ListSorter *sorter;
So, in the .m-file, I’ve got:
@synthesize sorter;
...
//Somewhere down in an IB-action
[sorter addItemToHistoryList:keuze];
I NSLogged both addItemToAlertList and addItemToHistoryList, but it always calls addItemToAlertList. Why’s that?
Solved it temporarily by creating two classes, both with one of the methods. My guess is the class didn’t get allocated properly.