PDA

View Full Version : Trying to remove data from graph




geiger10d
Apr 18, 2011, 07:20 PM
hey
i am trying to remove all data from a graph based on user data that they logged,

am i on the right track? i am not sure if i used the removeObjectFromKey method right..

obviously this does not work, i am just looking for some direction.






if ([[[sender titleLabel] text] isEqualToString:@"Reset"]) {
if ([[[NSUserDefaults standardUserDefaults] arrayForKey:@"ResetData"] count] > 1) {
NSMutableArray *ResetArray = [[NSMutableArray alloc] initWithArray:
[[NSUserDefaults standardUserDefaults] arrayForKey:@"ResetData"]];
[ResetArray removeObjectForKey];
[[NSUserDefaults standardUserDefaults] setObject:undoArray forKey:@"ResetData"];
[ResetArray release];
ResetArray = [[NSMutableArray alloc] initWithArray:
[[NSUserDefaults standardUserDefaults] arrayForKey:@"LoggedWeights"]];
[ResetArray removeObjectForKey];
[[NSUserDefaults standardUserDefaults] setObject:undoArray forKey:@"LoggedWeights"];
[[NSUserDefaults standardUserDefaults] synchronize];
[ResetArray release];
[graphView reloadData];


}

}