NSDate* date = [NSDate date];
NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease];
//Set the required date format
[formatter setDateFormat:@"MMM"];
//Get the string date
NSString* str = [formatter stringFromDate:date];
[_lbldateLabel setText:str];
[str uppercaseString];
i have the above code for displaying the month in label(_lbldateLabel),but i ant to show the date in capital letter,now it shows “Dec”,but i want “DEC”.I put [str uppercaseString];,but nothing changes,How to do this.
Thanks in advance.
[str uppercaseString]returns new string with uppercase characters, the original string remains unchanged. So you need to set the new string to your label: