I have set up the user defaults to record a integer for a UISlider, the problem is that, if the user has only just installed the app then the integer is zero or NULL. Is the
If zero is not a valid value in a normal usage case (i.e. your saved preference would never set this integer to zero), then you can check
if( [prefs integerForKey:@"senset"] == 0){
[prefs setInteger:25 forKey:@"senset"];
}
Edit: err, I suppose I have a question: when you try to overwrite it, are you setting an integer value(25) for your key (@"senset")? If not, then it will remain zero or nil, and everytime you check it will attempt to change your local senset variable to 25 again.