Trying to remove data from graph

Discussion in 'iPhone/iPad Programming' started by geiger10d, Apr 18, 2011.

  1. macrumors member

    Jan 31, 2011
    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];

Share This Page