我想过滤NSLog以获取我需要的唯一信息。 我的NSLog给了我:
Birthday : 05/24/1993
Id : xxxxxx (number)
我想只保留05/24/1993,有什么解决方案吗?
我的代码是:
- (void)viewDidLoad
{
[super viewDidLoad];
FBRequest *friendRequest = [FBRequest requestForGraphPath:@"/me?fields=birthday"];
[ friendRequest startWithCompletionHandler:^(FBRequestConnection *connection,id result, NSError *error) {
[[NSUserDefaults standardUserDefaults]setObject:result forKey:@"birthdayDate"];
self.birthdayArray=[[NSUserDefaults standardUserDefaults]objectForKey:@"birthdayDate"];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"birthdayDate contains[c] /"];
self.birthday = [self.birthdayArray filteredArrayUsingPredicate:predicate];
NSLog(@"BIRTHDAY : %@", self.birthday);
}