Hallo,
ich bin ein objektive-c Neuling. Hier meine bisherigen Erfahrungen mit einem Poti:
refToSelf = self;
liefert:
Implicit conversion of an Objective-C pointer to 'void *' is disallowed with ARC(Automatic Reference Counting)
Meine Versuche mit Hilfe von Google:
1. Selector:
- (void)callBackPoti:(id)sender:(int16_t)valuePoti{
[_labelPoti setStringValue:[NSString stringWithFormat:@"Rotary Poti: %d",valuePoti]];
}
...
SEL sel = @selector(callBackPoti:);
rotary_poti_register_callback(&rotaryPoti, ROTARY_POTI_CALLBACK_POSITION, sel);
crashed beim Drehen am Poti
2. c Style Callback
void callBack(int16_t valuePoti)
{
[[[[NSThread currentThread] threadDictionary] objectForKey:@"labelPoti"] setStringValue:[NSString stringWithFormat:@"Rotary Poti: %d", valuePoti]];
}
...
rotary_poti_register_callback(&rotaryPoti, ROTARY_POTI_CALLBACK_POSITION, &callBack);
tut nix :-(
Vielleicht gibt es einen Mac Experten, der weiterhilft. Sonst bleibe ich beim NSTimer.
Gruß an alle Mac User