저는 Parse로 그립을 잡아 간단한 채팅 앱을 만들려고합니다.PFInstallation 및 PFUser에 대한 포인터 추가
PFInstallation *installation = [PFInstallation currentInstallation];
installation[@"user"] = [PFUser currentUser];
[installation saveInBackground];
이 코드는 이렇게 푸시가 사용자 이름을 조회하여 전송 될 수있는 PFUser에 PFInstallation 연결 : 내 로그인 및 가입 코드에 대해 나는이 조각을 가지고있다.
응용 프로그램로드가 처음에 로그인 한 사용자가 이미 있는지 확인
:if ([PFUser currentUser]) {
[self performSegueWithIdentifier:@"showFriends" sender:nil];
}
사용자가 이미 쇼 친구에 기록되어있는 경우는 컨트롤러가로드 볼 수 있습니다. 이 코드에 사용자를 맞추기 위해 설치를 다시 설정해야합니까? 즉
if ([PFUser currentUser]) {
PFInstallation *installation = [PFInstallation currentInstallation];
[installation[@"user"] = [PFUser currentUser];
[installation saveInBackground];
[self performSegueWithIdentifier:@"showFriends" sender:nil];
}
사용자가 이미 로그인 했으므로 필요하지 않습니까? 나는 설치 파일이 유일하고 한 번만 생성되어 장치를 푸시 서비스와 일치 시키므로 실제로 내가 추가 한 PFUser 필드를 업데이트하지 않는 한 그 파일에서 아무 것도 변경되지 않는다고 생각합니까? 감사 표시가 친구보기 컨트롤러에로드되어있는 경우 사용자가 이미 로그인 한 경우
감사합니다. 그래서 if ([PFUser currentUser]) { [self performSegueWithIdentifier : @ "showFriends"sender : nil]의 instalation으로 PFUser를 재설정 할 필요가 없습니다. } 맞습니까? – Kex
맞음, 일단 관계가 설정되면, 당신이 다르게 말할 때까지 항상 그 상태를 유지할 것입니다 – soulshined