I'm trying to pass a parameter into a block but every configuration i do is throwing errors. The parameter im trying to pass in is of type Venue as you can see below.
Here is my perhaps incorrect declaration in the header
-(void)update:(Venue* (^)(NSArray *myScenes, NSError *error))block; Here is my implementation which i know is wrong because i cant reference the passed in variable but its the only thing not throwing an error
-(void)update:(Venue* (^)(NSArray *myScenes, NSError *error))block{ //download scenes PFQuery *query = [PFQuery queryWithClassName:@"Scenes"]; [query orderByDescending:@"createdAt"]; [query whereKey:@"venueId" equalTo:venue.objectId]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (error) { NSLog(@"Error: %@ %@", error, [error userInfo]); } else { // We found messages! scenes = objects; //[PFObject pinAllInBackground:objects]; NSLog(@"Retrieved %lu messages", (unsigned long)[scenes count]); NSLog(@"Venues = %@", scenes); } }]; } and heres how im calling it
[_venues[0] update:^Venue *(NSArray *myScenes, NSError *error) { if (error) { NSLog(@"Error: %@ %@", error, [error userInfo]); } else { NSLog(@"myObjects are: %@", myScenes); _venues[0].scenes = myScenes; } }]; wrong again. Basically i want to know how to declare this in a way that lets me pass in a variable of type Venue*