4

I have a button in the preference panel of my tweak that returns the settings to their default values (specifically there are 'PSEditTextCell's that are cleared). The button triggers an action that changes the values in the plist, but the changes don't become visible immediately: you have to return to the springboard then go back into settings to see the fields have been cleared. How do I get the preference view to refresh so changes are visible immediately?

zonofzin
  • 41
  • 1

1 Answers1

4

If your button is triggering an action within the PSListController of your pref. bundle, then you can call any of these methods to reload a specifier, on the PSListController:

-(void)reload;
-(void)reloadSpecifiers;
-(void)reloadSpecifierAtIndex:(int)index animated:(BOOL)animated;
-(void)reloadSpecifierAtIndex:(int)index;
-(void)reloadSpecifier:(PSSpecifier*)specifier animated:(BOOL)animated;
-(void)reloadSpecifier:(PSSpecifier*)specifier;
-(void)reloadSpecifierID:(NSString*)specifierID animated:(BOOL)animated;
-(void)reloadSpecifierID:(NSString*)specifierID;

Source: https://github.com/rpetrich/iphoneheaders/blob/master/Preferences/PSListController.h

Eric Castro
  • 135
  • 1
  • 6