みなさん、こんにちは...私のアプリには、現在のPFUserのすべてのデータを含むビューが含まれています。ios7のコードから直接ストーリーボードなしですべてが行われます...表示は問題ありませんが、実行時にログアウトしてから、以前とは別の別のユーザーで再度ログインし、情報を更新しませんでした。ビューは、そのユーザーのデータを、後で一緒に来たユーザーに引き続き保持します。
私の間違いはどこですか?
ローリーの皆様ありがとうございました
- (void)viewDidLoad
{
[super viewDidLoad];
[self FFCustomViewGraph];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}
-(void)viewDidAppear:(BOOL)animated {
self.navigationController.navigationBarHidden=NO;
}
-(void)FFCustomViewGraph {
if ([PFUser currentUser] != nil) {
PFQuery *query = [PFUser query];
[query whereKey:@"Nome_Cognome" equalTo:[PFUser currentUser]];
[query getFirstObjectInBackgroundWithBlock:^(PFObject *object, NSError *error) {
UIView *FFProfileView = [[UIView alloc] initWithFrame:CGRectMake(4, 68, 312, 123)];
[FFProfileView setBackgroundColor:[UIColor colorWithRed:(237/255.0) green:(237/255.0) blue:(237/255.0) alpha:(1)]];
[FFProfileView.layer setMasksToBounds:YES];
[FFProfileView.layer setCornerRadius:3];
[self.view addSubview:FFProfileView];
PFImageView *FFImageProfile = [[PFImageView alloc] initWithFrame:CGRectMake(104, 136, 105, 105)];
FFImageProfile.image = [UIImage imageNamed:@"FFIMG_Camera"];
FFImageProfile.file = (PFFile *)[[PFUser currentUser] objectForKey:@"foto"]; // remote image
[FFImageProfile.layer setMasksToBounds:YES];
[FFImageProfile.layer setCornerRadius:52.0f];
[FFImageProfile loadInBackground];
[self.view addSubview:FFImageProfile];
UILabel *FFNomeUsername = [[UILabel alloc] initWithFrame:CGRectMake(4, 59, 312, 70)];
[FFNomeUsername setFont:[UIFont systemFontOfSize:18]];
[FFNomeUsername setTextAlignment:NSTextAlignmentCenter];
[FFNomeUsername setText:@"Massimiliano De Pascale"];
[FFNomeUsername setTextColor:[UIColor colorWithRed:(158/255.0) green:(158/255.0) blue:(158/255.0) alpha:(1)]];
FFNomeUsername.text = [[PFUser currentUser] objectForKey:@"Nome_Cognome"];
[self.view addSubview:FFNomeUsername];
}];
} else {
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)FFLogout:(id)sender {
[PFUser logOut];
[self performSegueWithIdentifier:@"Login" sender:self];
}
@end