title: Parse Platform iOS. Unable to add relation
body: <p>I have two parse classes with a relation between them:</p>
  <pre><code>class FeedPost:PFObject, PFSubclassing {
      @NSManaged var likedBy:PFRelation&lt;PFUser&gt;
      static func parseClassName() -&gt; String {
          return &quot;FeedPost&quot;
      }
  }
  
  extension PFUser {
      @NSManaged var likedPosts:PFRelation&lt;FeedPost&gt;
  }
  </code></pre>
  <p>I'm trying to create a relation between the two objects when the user likes a post with the following code:</p>
  <pre><code>    if let currentUser = PFUser.current() {
          let likeQuery = post.likedBy.query()
          likeQuery.findObjectsInBackground { (users, error) in
              if let users = users {
                  if !users.contains(where: {$0.objectId == currentUser.objectId}) {
                      post.likeCount += 1
                      post.likedBy.add(currentUser)
                      currentUser.likedPosts.add(post)
                      ParseNetworkQuery.shared.bulkSaveObjects(objects: [currentUser,post]) { (done) in
                              
                      }
                  }
              }
          }
      }
  </code></pre>
  <p>When I run this code, I get the following error:</p>
  <pre><code>Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
  </code></pre>
  <p>The error points to the following line in the PFRelation.m file, specifically on the dispatch_sync line:</p>
  <pre><code>- (void)_addKnownObject:(PFObject *)object {
  dispatch_sync(_stateAccessQueue, ^{
      [self.state.knownObjects addObject:object];
  });
  }
  </code></pre>
  <p>I've tried &quot;pre-adding&quot; the relations to both classes in the data browser. When this is done the error happens. If I remove the relations in the data browser, and let the code generate them itself when it runs, nothing happens. The columns are not created, and the &quot;likeQuery&quot; never executes. What am I doing wrong? Thanks!</p>