Я пытаюсь передать 3 объекта другому VC, но они отображаются как пустые в целевом VC.
VC1:
- (void)specificExerciseTableViewController:(SpecificExerciseTableViewController *)specificExerciseTableViewController didSelectSpecificExerciseWithURL:(NSString *)exerciseURL muscleName:(NSString *)muscleName muscleURL:(NSString *)muscleURL;
{
[self addExercise];
}
-(void)addExercise
{
PFObject *exerciseInRoutine = [[PFObject alloc] initWithClassName:@"exerciseInRoutine"];
[exerciseInRoutine setObject:self.selectedExercise forKey:@"name"];
[exerciseInRoutine setObject:self.muscleName forKey:@"muscle"];
[exerciseInRoutine setObject:self.muscleURL forKey:@"picture"];
[exerciseInRoutine saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (!error) {
[self.tableView reloadData];
} else {
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
}];
}
Класс, который передает объекты в VC1:
if ([self.delegate respondsToSelector:@selector(specificExerciseTableViewController:didSelectSpecificExerciseWithURL:muscleName:muscleURL:)])
{
NSString *exerciseName = [[self.exerciseArray objectAtIndex:selectedRowIndex.row] objectForKey:@"exerciseName"];
[self.delegate specificExerciseTableViewController:self didSelectSpecificExerciseWithURL:exerciseName muscleName:self.muscleName muscleURL:self.muscleURL];
[self dismissModalViewControllerAnimated:YES];
}
Edit:
Я обновил свой метод, чтобы установить объекты в свойствах ВК, но у меня возникла та же проблема:
- (void)specificExerciseTableViewController:(SpecificExerciseTableViewController *)specificExerciseTableViewController didSelectSpecificExerciseWithURL:(NSString *)exerciseURL muscleName:(NSString *)muscleName muscleURL:(NSString *)muscleURL;
{
self.muscleName = exerciseURL;
self.muscleName = muscleName;
self.muscleURL = muscleURL;
[self addExercise];
}