The following is my one of the items in my settings bundle. It is a simple linked list that allows users to choose a different note color for my application.
So far, I am retrieving the object through the key "noteColor." This will eventually allow me to determine which value was selected in my linked list.
NSString *path = @"/var/mobile/Library/Preferences/NCNotes.plist";
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
noteColor = [[dict objectForKey:@"noteColor"] intValue];
One thing I'm unsure about so far is if noteColor should be an integer or not. I'm assuming so, because I am using numbers for my values.
Assuming this is correct, I then try to switch the color of my note depending on the value that was selected (using cases). This doesn't seem to work.
switch (noteColor) {
case 0:
// Black
noteView.textColor = [UIColor purpleColor];
break;
case 1:
// Blue
noteView.textColor = [UIColor purpleColor];
break;
}
Any ideas of what I am doing wrong?