I have an Application Delegate class with a enumeration which looks like this:
typedef enum {
Online = 3500,
DoNotDisturb = 9500,
Offline = 18500,
Away = 15500,
Busy = 6500,
BeRightBack = 12500
} status;
Additionally I have a property to set a value from the enumerator in my interface file:
@interface MyAppDelegate : NSObject <UIApplicationDelegate> {
status userStatus;
}
@property (nonatomic, setter=setStatus) status userStatus;
@end
Finally I have the following message in my implementation file:
@implementation Communicator2AppDelegate
- (void)setStatus:(status)_userStatus {
if ([NSThread isMainThread]) {
// some stuff happens here ...
} else {
[self performSelectorOnMainThread:@selector(setStatus:) withObject:_userStatus waitUntilDone:NO];
}
}
My issue is the following: the performSelectorOnMainThread message isn't working because it doesn't accept '_userStatus' as a value. My guess is the message assumes it's an enum, not a real value. I get the following error message upon compilation: "Incompatible type for argument 2 of 'performSelectorOnMainThread:withObject:waitUntilDone.'"
Does anyone have any idea on how to make this work?