2014-11-25 2 views
2

구문 분석에서 ACL을 설정해야하지만 코드를 넣을 위치를 알지 못합니다. 나는이를 배치해야합니까어떻게 구문 분석에서 ACL을 설정합니까?

PFUser *user = [PFUser currentUser]; 

user.ACL = [PFACL ACLWithUser:user]; 

을 다음과 같이

은 오브젝티브 C의 코드는 무엇입니까? 또한; 누구든지 이것을 신속하게 번역하는 방법을 알고 있습니까?

진행 방법에 대한 의견을 보내 주시면 감사하겠습니다.

답변

2

저는 이것을 Swift의 Parse에서 UserPhoto 클래스에 대해 이전에 수행했습니다. 이것은 사용자가 새로운 이미지를 선택할 때 호출되는 func 내의 코드입니다. ACL 부분은 4 호선에 있습니다 :

var userPhoto = PFObject(className: "UserPhoto") 
//imageFile is NSData passed to func 
userPhoto.setObject(imageFile, forKey: "imageFile") 
userPhoto.ACL = PFACL(user: PFUser.currentUser()) 
userPhoto.setObject(PFUser.currentUser(), forKey: "user") 
//save 
userPhoto.saveInBackgroundWithBlock({ (success, error) -> Void in 
    println("Saved new userPhoto to Parse") 
}) 

희망이 있습니다.

관련 문제