i have a slider connected to this action. i've declared the static NSString to use for the default's key. and i want to log the results of the slider using the key...
unfortunately, this only logs "defaultSizeKEY" when the slider is changed.
this works fine, but i need to access the [sender intValue] in a -(void)mouseDragged: (NSEvent *)event method of a different class.
NSMakeSize(64,64) works fine, but these are the number i need changed using the slider that is bound to the defaultSizeKEY string.
as mentioned above writing NSMakeSize(defaultSizeKEY, defaultSizeKEY) doesn't work, and i can't write NSMakeSize([sender intValue]) because the sender is not connected to this mouseDragged event method...
*head explodes*
Code:
static NSString *const defaultSizeKEY = @"defaultSizeKEY";
- (IBAction)changeSize:(id)sender
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setValue:[NSNumber numberWithInt:[sender intValue]] forKey:defaultSizeKEY];
NSLog (@"%@", defaultSizeKEY);
}
unfortunately, this only logs "defaultSizeKEY" when the slider is changed.
Code:
NSLog (@"@i", [sender intValue]);
this works fine, but i need to access the [sender intValue] in a -(void)mouseDragged: (NSEvent *)event method of a different class.
Code:
- (void)mouseDragged:(NSEvent *)event
{
NSSize size = NSMakeSize(64, 64);
}
NSMakeSize(64,64) works fine, but these are the number i need changed using the slider that is bound to the defaultSizeKEY string.
as mentioned above writing NSMakeSize(defaultSizeKEY, defaultSizeKEY) doesn't work, and i can't write NSMakeSize([sender intValue]) because the sender is not connected to this mouseDragged event method...
*head explodes*