Created
March 9, 2012 14:47
-
-
Save vinzenzweber/2006812 to your computer and use it in GitHub Desktop.
RestKit mapping using primary key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////// | |
// Categories - Exercises | |
NSArray *categoriesMap = [NSArray arrayWithObjects:@"uid", @"text_de", @"text_en", nil]; | |
RKManagedObjectMapping *exerciseLevelMapping = [RKManagedObjectMapping mappingForClass:[ExerciseLevel class]]; | |
exerciseLevelMapping.primaryKeyAttribute = @"uid"; | |
[exerciseLevelMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:exerciseLevelMapping forKeyPath:@"exercise-categories.level"]; | |
RKManagedObjectMapping *exerciseEquipmentMapping = [RKManagedObjectMapping mappingForClass:[ExerciseEquipment class]]; | |
exerciseEquipmentMapping.primaryKeyAttribute = @"uid"; | |
[exerciseEquipmentMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:exerciseEquipmentMapping forKeyPath:@"exercise-categories.equipment"]; | |
RKManagedObjectMapping *exerciseBodyregionMapping = [RKManagedObjectMapping mappingForClass:[ExerciseBodyregion class]]; | |
exerciseBodyregionMapping.primaryKeyAttribute = @"uid"; | |
[exerciseBodyregionMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:exerciseBodyregionMapping forKeyPath:@"exercise-categories.bodyregion"]; | |
RKManagedObjectMapping *exerciseMuscleMapping = [RKManagedObjectMapping mappingForClass:[ExerciseMuscle class]]; | |
exerciseMuscleMapping.primaryKeyAttribute = @"uid"; | |
[exerciseMuscleMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:exerciseMuscleMapping forKeyPath:@"exercise-categories.muscle"]; | |
RKManagedObjectMapping *exerciseGoalMapping = [RKManagedObjectMapping mappingForClass:[ExerciseGoal class]]; | |
exerciseGoalMapping.primaryKeyAttribute = @"uid"; | |
[exerciseGoalMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:exerciseGoalMapping forKeyPath:@"exercise-categories.goal"]; | |
RKManagedObjectMapping *exerciseExecutionMapping = [RKManagedObjectMapping mappingForClass:[ExerciseExecution class]]; | |
exerciseExecutionMapping.primaryKeyAttribute = @"uid"; | |
[exerciseExecutionMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:exerciseExecutionMapping forKeyPath:@"exercise-categories.execution"]; | |
RKManagedObjectMapping *exerciseTypeMapping = [RKManagedObjectMapping mappingForClass:[ExerciseType class]]; | |
exerciseTypeMapping.primaryKeyAttribute = @"uid"; | |
[exerciseTypeMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:exerciseTypeMapping forKeyPath:@"exercise-categories.type"]; | |
RKManagedObjectMapping *exerciseLocationMapping = [RKManagedObjectMapping mappingForClass:[ExerciseLocation class]]; | |
exerciseLocationMapping.primaryKeyAttribute = @"uid"; | |
[exerciseLocationMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:exerciseLocationMapping forKeyPath:@"exercise-categories.location"]; | |
/////////////////////////////////////// | |
// Categories - Workouts | |
RKManagedObjectMapping *workoutLevelMapping = [RKManagedObjectMapping mappingForClass:[WorkoutLevel class]]; | |
workoutLevelMapping.primaryKeyAttribute = @"uid"; | |
[workoutLevelMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:workoutLevelMapping forKeyPath:@"workout-categories.level"]; | |
RKManagedObjectMapping *workoutEquipmentMapping = [RKManagedObjectMapping mappingForClass:[WorkoutEquipment class]]; | |
workoutEquipmentMapping.primaryKeyAttribute = @"uid"; | |
[workoutEquipmentMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:workoutEquipmentMapping forKeyPath:@"workout-categories.equipment"]; | |
RKManagedObjectMapping *workoutBodyregionMapping = [RKManagedObjectMapping mappingForClass:[WorkoutBodyregion class]]; | |
workoutBodyregionMapping.primaryKeyAttribute = @"uid"; | |
[workoutBodyregionMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:workoutBodyregionMapping forKeyPath:@"workout-categories.bodyregion"]; | |
RKManagedObjectMapping *workoutDurationMapping = [RKManagedObjectMapping mappingForClass:[WorkoutDuration class]]; | |
workoutDurationMapping.primaryKeyAttribute = @"uid"; | |
[workoutDurationMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:workoutDurationMapping forKeyPath:@"workout-categories.duration"]; | |
RKManagedObjectMapping *workoutGoalMapping = [RKManagedObjectMapping mappingForClass:[WorkoutGoal class]]; | |
workoutGoalMapping.primaryKeyAttribute = @"uid"; | |
[workoutGoalMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:workoutGoalMapping forKeyPath:@"workout-categories.goal"]; | |
RKManagedObjectMapping *workoutTypeMapping = [RKManagedObjectMapping mappingForClass:[WorkoutType class]]; | |
workoutTypeMapping.primaryKeyAttribute = @"uid"; | |
[workoutTypeMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:workoutTypeMapping forKeyPath:@"workout-categories.type"]; | |
RKManagedObjectMapping *workoutLocationMapping = [RKManagedObjectMapping mappingForClass:[WorkoutLocation class]]; | |
workoutLocationMapping.primaryKeyAttribute = @"uid"; | |
[workoutLocationMapping mapAttributesFromArray:categoriesMap]; | |
[objectManager.mappingProvider setMapping:workoutLocationMapping forKeyPath:@"workout-categories.location"]; | |
/////////////////////////////////////// | |
// Exercise | |
RKManagedObjectMapping *exerciseMapping = [RKManagedObjectMapping mappingForClass:[Exercise class]]; | |
exerciseMapping.primaryKeyAttribute = @"uid"; | |
[exerciseMapping mapAttributes:@"uid", @"version", @"name", @"brightcoveVideoID", @"level_uid", @"equipment_uid", @"bodyregion_uid", @"muscle_uid", @"goal_uid", @"execution_uid", @"type_uid", @"location_uid", nil]; | |
// ExerciseStep | |
RKManagedObjectMapping *exerciseStepMapping = [RKManagedObjectMapping mappingForClass:[ExerciseStep class]]; | |
[exerciseStepMapping mapAttributes:@"order", @"text", @"imageURL", nil]; | |
// Exercise -> ExerciseStep | |
[exerciseMapping hasMany:@"steps" withMapping:exerciseStepMapping]; | |
// Level | |
[exerciseMapping hasOne:@"level" withMapping:exerciseLevelMapping]; | |
[exerciseMapping connectRelationship:@"level" withObjectForPrimaryKeyAttribute:@"level_uid"]; | |
// Equipment | |
[exerciseMapping hasMany:@"equipment" withMapping:exerciseEquipmentMapping]; | |
[exerciseMapping connectRelationship:@"equipment" withObjectForPrimaryKeyAttribute:@"equipment_uid"]; | |
/* | |
// Bodyregion | |
[exerciseMapping hasMany:@"bodyregions" withMapping:exerciseBodyregionMapping]; | |
[exerciseMapping connectRelationship:@"bodyregions" withObjectForPrimaryKeyAttribute:@"bodyregion_uid"]; | |
// Muscle | |
[exerciseMapping hasMany:@"muscles" withMapping:exerciseMuscleMapping]; | |
[exerciseMapping connectRelationship:@"muscles" withObjectForPrimaryKeyAttribute:@"muscle_uid"]; | |
// Goal | |
[exerciseMapping hasMany:@"goals" withMapping:exerciseGoalMapping]; | |
[exerciseMapping connectRelationship:@"goals" withObjectForPrimaryKeyAttribute:@"goal_uid"]; | |
// Execution | |
[exerciseMapping hasOne:@"execution" withMapping:exerciseExecutionMapping]; | |
[exerciseMapping connectRelationship:@"execution" withObjectForPrimaryKeyAttribute:@"execution_uid"]; | |
// Type | |
[exerciseMapping hasOne:@"type" withMapping:exerciseTypeMapping]; | |
[exerciseMapping connectRelationship:@"type" withObjectForPrimaryKeyAttribute:@"type_uid"]; | |
// Location | |
[exerciseMapping hasOne:@"location" withMapping:exerciseLocationMapping]; | |
[exerciseMapping connectRelationship:@"location" withObjectForPrimaryKeyAttribute:@"location_uid"]; | |
*/ | |
// Register mapping | |
[objectManager.mappingProvider setMapping:exerciseMapping forKeyPath:@"exercises"]; | |
/////////////////////////////////////// | |
// Workout | |
RKManagedObjectMapping *workoutMapping = [RKManagedObjectMapping mappingForClass:[Workout class]]; | |
workoutMapping.primaryKeyAttribute = @"uid"; | |
[workoutMapping mapAttributes:@"uid", @"version", @"name", @"text", @"imageURL", nil]; | |
// WorkoutExercise | |
RKManagedObjectMapping *workoutExerciseMapping = [RKManagedObjectMapping mappingForClass:[WorkoutExercise class]]; | |
[workoutExerciseMapping mapAttributes:@"order", @"exercise_uid", nil]; | |
// WorkoutExercise -> Exercise | |
[workoutExerciseMapping hasOne:@"exercise" withMapping:exerciseMapping]; | |
[workoutExerciseMapping connectRelationship:@"exercise" withObjectForPrimaryKeyAttribute:@"exercise_uid"]; | |
// Set | |
RKManagedObjectMapping *setMapping = [RKManagedObjectMapping mappingForClass:[Set class]]; | |
[setMapping mapAttributes:@"order", @"repetitions", @"weight", @"pause", nil]; | |
// WorkoutExercise -> Set | |
[workoutExerciseMapping hasMany:@"sets" withMapping:setMapping]; | |
// Workout -> WorkoutExercise | |
[workoutMapping mapKeyPath:@"exercises" toRelationship:@"workoutExercises" withMapping:workoutExerciseMapping]; | |
// Register our mappings with the provider | |
[objectManager.mappingProvider setMapping:workoutMapping forKeyPath:@"workouts"]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"exercise-categories": { | |
"level": [ | |
{ | |
"uid": 1, | |
"text_de": "Anfänger" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Fortgeschrittener" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Profi" | |
} | |
], | |
"equipment": [ | |
{ | |
"uid": 1, | |
"text_de": "Ohne Geräte" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Kurzhantel" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Langhantel" | |
}, | |
{ | |
"uid": 4, | |
"text_de": "SZ-Hantel" | |
}, | |
{ | |
"uid": 5, | |
"text_de": "Studio-Geräte" | |
}, | |
{ | |
"uid": 6, | |
"text_de": "Swiss Ball" | |
}, | |
{ | |
"uid": 7, | |
"text_de": "Stepboard" | |
}, | |
{ | |
"uid": 8, | |
"text_de": "Balance-Board" | |
}, | |
{ | |
"uid": 9, | |
"text_de": "Balance-Kissen" | |
}, | |
{ | |
"uid": 10, | |
"text_de": "Dehnband" | |
}, | |
{ | |
"uid": 11, | |
"text_de": "Tubes" | |
}, | |
{ | |
"uid": 12, | |
"text_de": "Medizinball" | |
}, | |
{ | |
"uid": 13, | |
"text_de": "Kabelzugturm" | |
}, | |
{ | |
"uid": 14, | |
"text_de": "Kettlebell" | |
}, | |
{ | |
"uid": 15, | |
"text_de": "Schlingensystem" | |
}, | |
{ | |
"uid": 16, | |
"text_de": "Burn-Machine" | |
}, | |
{ | |
"uid": 17, | |
"text_de": "Balance-Halbball" | |
}, | |
{ | |
"uid": 18, | |
"text_de": "Ringband" | |
}, | |
{ | |
"uid": 19, | |
"text_de": "Klimmzugstange" | |
}, | |
{ | |
"uid": 20, | |
"text_de": "Hantelbank" | |
} | |
], | |
"bodyregion": [ | |
{ | |
"uid": 1, | |
"text_de": "Arme" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Schultern" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Rücken" | |
}, | |
{ | |
"uid": 4, | |
"text_de": "Brust" | |
}, | |
{ | |
"uid": 5, | |
"text_de": "Bauch" | |
}, | |
{ | |
"uid": 6, | |
"text_de": "Beine" | |
}, | |
{ | |
"uid": 7, | |
"text_de": "Gesäß" | |
} | |
], | |
"muscle": [ | |
{ | |
"uid": 1, | |
"text_de": "Bizeps (biceps brachii)" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Trizeps (triceps brachii)" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Handgelenksbeuger (flexores carpi)" | |
}, | |
{ | |
"uid": 4, | |
"text_de": "Handgelenksstrecker (extensores carpi)" | |
}, | |
{ | |
"uid": 5, | |
"text_de": "Deltamuskel (deltoideus)" | |
}, | |
{ | |
"uid": 6, | |
"text_de": "Kapuzenmuskel (trapezius)" | |
}, | |
{ | |
"uid": 7, | |
"text_de": "Rotatorenmanschette (supraspinatus, infraspinatus, teres minor, subscapularis)" | |
}, | |
{ | |
"uid": 8, | |
"text_de": "breiter Rückenmuskel (latissimus dorsi)" | |
}, | |
{ | |
"uid": 9, | |
"text_de": "Rückenstrecker (autochthone Rückenmuskulatur) " | |
}, | |
{ | |
"uid": 10, | |
"text_de": "Brustmuskulatur (pectoralis major und minor)" | |
}, | |
{ | |
"uid": 11, | |
"text_de": "obere Bauchmuskeln (rectus abdominis) " | |
}, | |
{ | |
"uid": 12, | |
"text_de": "untere Bauchmuskeln (rectus abdominis) " | |
}, | |
{ | |
"uid": 13, | |
"text_de": "seitliche Bauchmuskeln (obliquus externus und internus abdominis)" | |
}, | |
{ | |
"uid": 14, | |
"text_de": "Beinstrecker (quadriceps femoris) " | |
}, | |
{ | |
"uid": 15, | |
"text_de": "Beinbeuger (biceps femoris)" | |
}, | |
{ | |
"uid": 16, | |
"text_de": "Abduktoren (abductores femori)" | |
}, | |
{ | |
"uid": 17, | |
"text_de": "Adduktoren (adductores femori) " | |
}, | |
{ | |
"uid": 18, | |
"text_de": "Wadenmuskulatur (gastrocnemius und soleus)" | |
}, | |
{ | |
"uid": 19, | |
"text_de": "Schienbeinmuskulatur (tibialis anterior)" | |
}, | |
{ | |
"uid": 20, | |
"text_de": "Gesäßmuskulatur (glutaeus maximus, medius und minimus) " | |
} | |
], | |
"goal": [ | |
{ | |
"uid": 1, | |
"text_de": "Kraft" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Beweglichkeit" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Explosivität" | |
}, | |
{ | |
"uid": 4, | |
"text_de": "Koordination" | |
} | |
], | |
"execution": [ | |
{ | |
"uid": 1, | |
"text_de": "dynamisch" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "statisch" | |
} | |
], | |
"type": [ | |
{ | |
"uid": 1, | |
"text_de": "isolierte Übung" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "mehrgelenkige Übung" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Compound-Übung" | |
} | |
], | |
"location": [ | |
{ | |
"uid": 1, | |
"text_de": "Studio" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Outdoor" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Home" | |
}, | |
{ | |
"uid": 4, | |
"text_de": "Büro" | |
}, | |
{ | |
"uid": 5, | |
"text_de": "Hotel" | |
} | |
] | |
}, | |
"workout-categories": { | |
"level": [ | |
{ | |
"uid": 1, | |
"text_de": "Anfänger" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Fortgeschrittener" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Profis" | |
} | |
], | |
"goal": [ | |
{ | |
"uid": 1, | |
"text_de": "Beweglichkeit" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Gesundheit" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Abnehmen" | |
}, | |
{ | |
"uid": 4, | |
"text_de": "Muskelaufbau" | |
}, | |
{ | |
"uid": 5, | |
"text_de": "Kraftzuwachs" | |
}, | |
{ | |
"uid": 6, | |
"text_de": "Fitness steigern" | |
} | |
], | |
"bodyregion": [ | |
{ | |
"uid": 1, | |
"text_de": "Brust" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Rücken" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "Rücken" | |
}, | |
{ | |
"uid": 4, | |
"text_de": "Bauch" | |
}, | |
{ | |
"uid": 5, | |
"text_de": "Beine" | |
}, | |
{ | |
"uid": 6, | |
"text_de": "Ganzkörper" | |
} | |
], | |
"equipment": [ | |
{ | |
"uid": 1, | |
"text_de": "Mit Hilfsmittel" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Ohne Hilfsmittel" | |
} | |
], | |
"location": [ | |
{ | |
"uid": 1, | |
"text_de": "Studio" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Home" | |
} | |
], | |
"duration": [ | |
{ | |
"uid": 1, | |
"text_de": "bis 30 Minuten" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "30 bis 45 Minuten" | |
}, | |
{ | |
"uid": 3, | |
"text_de": "ab 45 Minuten" | |
} | |
], | |
"type": [ | |
{ | |
"uid": 1, | |
"text_de": "Mehrstationentraining" | |
}, | |
{ | |
"uid": 2, | |
"text_de": "Zirkeltraining" | |
} | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Exercise.h | |
// PersonalTrainer | |
// | |
// Created by Vinzenz-Emanuel Weber on 14.03.12. | |
// Copyright (c) 2012 Blockhaus Medienagentur. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <CoreData/CoreData.h> | |
@class ExerciseBodyregion, ExerciseEquipment, ExerciseExecution, ExerciseGoal, ExerciseLevel, ExerciseLocation, ExerciseMuscle, ExerciseStep, ExerciseType; | |
@interface Exercise : NSManagedObject | |
@property (nonatomic, retain) NSMutableArray * bodyregion_uid; | |
@property (nonatomic, retain) NSNumber * brightcoveVideoID; | |
@property (nonatomic, retain) NSMutableArray * equipment_uid; | |
@property (nonatomic, retain) NSNumber * execution_uid; | |
@property (nonatomic, retain) NSMutableArray * goal_uid; | |
@property (nonatomic, retain) NSNumber * imageIndex; | |
@property (nonatomic, retain) NSNumber * level_uid; | |
@property (nonatomic, retain) NSNumber * location_uid; | |
@property (nonatomic, retain) NSMutableArray * muscle_uid; | |
@property (nonatomic, retain) NSString * name; | |
@property (nonatomic, retain) NSNumber * type_uid; | |
@property (nonatomic, retain) NSNumber * uid; | |
@property (nonatomic, retain) NSNumber * version; | |
@property (nonatomic, retain) NSSet *bodyregions; | |
@property (nonatomic, retain) NSSet *equipment; | |
@property (nonatomic, retain) ExerciseExecution *execution; | |
@property (nonatomic, retain) NSSet *goals; | |
@property (nonatomic, retain) ExerciseLevel *level; | |
@property (nonatomic, retain) ExerciseLocation *location; | |
@property (nonatomic, retain) NSSet *muscles; | |
@property (nonatomic, retain) NSSet *steps; | |
@property (nonatomic, retain) ExerciseType *type; | |
@end | |
@interface Exercise (CoreDataGeneratedAccessors) | |
- (void)addBodyregionsObject:(ExerciseBodyregion *)value; | |
- (void)removeBodyregionsObject:(ExerciseBodyregion *)value; | |
- (void)addBodyregions:(NSSet *)values; | |
- (void)removeBodyregions:(NSSet *)values; | |
- (void)addEquipmentObject:(ExerciseEquipment *)value; | |
- (void)removeEquipmentObject:(ExerciseEquipment *)value; | |
- (void)addEquipment:(NSSet *)values; | |
- (void)removeEquipment:(NSSet *)values; | |
- (void)addGoalsObject:(ExerciseGoal *)value; | |
- (void)removeGoalsObject:(ExerciseGoal *)value; | |
- (void)addGoals:(NSSet *)values; | |
- (void)removeGoals:(NSSet *)values; | |
- (void)addMusclesObject:(ExerciseMuscle *)value; | |
- (void)removeMusclesObject:(ExerciseMuscle *)value; | |
- (void)addMuscles:(NSSet *)values; | |
- (void)removeMuscles:(NSSet *)values; | |
- (void)addStepsObject:(ExerciseStep *)value; | |
- (void)removeStepsObject:(ExerciseStep *)value; | |
- (void)addSteps:(NSSet *)values; | |
- (void)removeSteps:(NSSet *)values; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"exercises": [ | |
{ | |
"uid": 1, | |
"version": 2, | |
"name": "Frosch 1", | |
"brightcoveVideoID": 1423522820001, | |
"level_uid": 1, | |
"equipment_uid": [ | |
2, | |
6, | |
8 | |
], | |
"bodyregion_uid": [ | |
1, | |
2, | |
3, | |
7 | |
], | |
"muscle_uid": [ | |
1, | |
2, | |
3, | |
7, | |
15, | |
20 | |
], | |
"goal_uid": [ | |
1, | |
4 | |
], | |
"execution_uid": 1, | |
"type_uid": 2, | |
"location_uid": 5, | |
"steps": [ | |
{ | |
"order": 1, | |
"text": "Heb den Fuß hoch.", | |
"imageURL": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcRnp_RGiu0eKJh3yms_LyB6JVcZL1-i28oWkqkUzh1ltmYZtby9cw" | |
}, | |
{ | |
"order": 2, | |
"text": "Spreiz deine Zehen ab.", | |
"imageURL": "https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcSLFEZJ5bn8U6RnhE5e2C387Wlv36MQ2w1KpRY1QdItALMNmMZOnA" | |
}, | |
{ | |
"order": 3, | |
"text": "Berühr dein Ohr.", | |
"imageURL": "https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcTs0DhPvLWeo8f2RAzcByUlp_d8E3XQKZ-Alhu4C_ijv541eCfATg" | |
}, | |
{ | |
"order": 4, | |
"text": "Wirf dein Bein über die Schulter.", | |
"imageURL": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcTl-IAZ-Awimd75szgRqeH_vB4z8dGVKQV1pPicYKdED9gypBkUPw" | |
} | |
] | |
}, | |
{ | |
"uid": 2, | |
"version": 2, | |
"name": "Frosch 2", | |
"brightcoveVideoID": 1423522820001, | |
"level_uid": 3, | |
"equipment_uid": [ | |
2 | |
], | |
"bodyregion_uid": [ | |
1, | |
2 | |
], | |
"muscle_uid": [ | |
1, | |
7 | |
], | |
"goal_uid": [ | |
1, | |
3 | |
], | |
"execution_uid": 1, | |
"type_uid": 3, | |
"location_uid": 2, | |
"steps": [ | |
{ | |
"order": 1, | |
"text": "Heb den Fuß hoch.", | |
"imageURL": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcRnp_RGiu0eKJh3yms_LyB6JVcZL1-i28oWkqkUzh1ltmYZtby9cw" | |
}, | |
{ | |
"order": 2, | |
"text": "Spreiz deine Zehen ab.", | |
"imageURL": "https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcSLFEZJ5bn8U6RnhE5e2C387Wlv36MQ2w1KpRY1QdItALMNmMZOnA" | |
}, | |
{ | |
"order": 3, | |
"text": "Berühr dein Ohr.", | |
"imageURL": "https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcTs0DhPvLWeo8f2RAzcByUlp_d8E3XQKZ-Alhu4C_ijv541eCfATg" | |
}, | |
{ | |
"order": 4, | |
"text": "Wirf dein Bein über die Schulter.", | |
"imageURL": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcTl-IAZ-Awimd75szgRqeH_vB4z8dGVKQV1pPicYKdED9gypBkUPw" | |
} | |
] | |
}, | |
{ | |
"uid": 3, | |
"version": 2, | |
"name": "Frosch 3", | |
"brightcoveVideoID": 1423522820001, | |
"level_uid": 2, | |
"equipment_uid": [ | |
8 | |
], | |
"bodyregion_uid": [ | |
3, | |
7 | |
], | |
"muscle_uid": [ | |
7, | |
15, | |
20 | |
], | |
"goal_uid": [ | |
3 | |
], | |
"execution_uid": 2, | |
"type_uid": 2, | |
"location_uid": 1, | |
"steps": [ | |
{ | |
"order": 1, | |
"text": "Heb den Fuß hoch.", | |
"imageURL": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcRnp_RGiu0eKJh3yms_LyB6JVcZL1-i28oWkqkUzh1ltmYZtby9cw" | |
}, | |
{ | |
"order": 2, | |
"text": "Spreiz deine Zehen ab.", | |
"imageURL": "https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcSLFEZJ5bn8U6RnhE5e2C387Wlv36MQ2w1KpRY1QdItALMNmMZOnA" | |
}, | |
{ | |
"order": 3, | |
"text": "Berühr dein Ohr.", | |
"imageURL": "https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcTs0DhPvLWeo8f2RAzcByUlp_d8E3XQKZ-Alhu4C_ijv541eCfATg" | |
}, | |
{ | |
"order": 4, | |
"text": "Wirf dein Bein über die Schulter.", | |
"imageURL": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcTl-IAZ-Awimd75szgRqeH_vB4z8dGVKQV1pPicYKdED9gypBkUPw" | |
} | |
] | |
} | |
], | |
"workouts": [ | |
{ | |
"uid": 1, | |
"version": 2, | |
"name": "Workout Master 3", | |
"text": "Das beste Workout das die Menschheit je gesehen hat!", | |
"imageURL": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcTl-IAZ-Awimd75szgRqeH_vB4z8dGVKQV1pPicYKdED9gypBkUPw", | |
"exercises": [ | |
{ | |
"order": 1, | |
"exercise_uid": 1, | |
"sets": [ | |
{ | |
"order": 1, | |
"repetitions": 15, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 2, | |
"repetitions": 14, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 3, | |
"repetitions": 13, | |
"weight": 30, | |
"pause": 45 | |
} | |
] | |
}, | |
{ | |
"order": 2, | |
"exercise_uid": 2, | |
"sets": [ | |
{ | |
"order": 1, | |
"repetitions": 15, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 2, | |
"repetitions": 14, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 3, | |
"repetitions": 13, | |
"weight": 30, | |
"pause": 45 | |
} | |
] | |
}, | |
{ | |
"order": 3, | |
"exercise_uid": 3, | |
"sets": [ | |
{ | |
"order": 1, | |
"repetitions": 15, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 2, | |
"repetitions": 14, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 3, | |
"repetitions": 13, | |
"weight": 30, | |
"pause": 45 | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"uid": 2, | |
"version": 2, | |
"name": "Workout Master 2", | |
"text": "Das beste Workout das die Menschheit je gesehen hat!", | |
"imageURL": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcTl-IAZ-Awimd75szgRqeH_vB4z8dGVKQV1pPicYKdED9gypBkUPw", | |
"exercises": [ | |
{ | |
"order": 1, | |
"exercise_uid": 1, | |
"sets": [ | |
{ | |
"order": 1, | |
"repetitions": 15, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 2, | |
"repetitions": 14, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 3, | |
"repetitions": 13, | |
"weight": 30, | |
"pause": 45 | |
} | |
] | |
}, | |
{ | |
"order": 2, | |
"exercise_uid": 2, | |
"sets": [ | |
{ | |
"order": 1, | |
"repetitions": 15, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 2, | |
"repetitions": 14, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 3, | |
"repetitions": 13, | |
"weight": 30, | |
"pause": 45 | |
} | |
] | |
}, | |
{ | |
"order": 3, | |
"exercise_uid": 3, | |
"sets": [ | |
{ | |
"order": 1, | |
"repetitions": 15, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 2, | |
"repetitions": 14, | |
"weight": 30, | |
"pause": 45 | |
}, | |
{ | |
"order": 3, | |
"repetitions": 13, | |
"weight": 30, | |
"pause": 45 | |
} | |
] | |
} | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// WorkoutExercise.h | |
// PersonalTrainer | |
// | |
// Created by Vinzenz-Emanuel Weber on 13.03.12. | |
// Copyright (c) 2012 Blockhaus Medienagentur. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <CoreData/CoreData.h> | |
@class Exercise, Set, Workout; | |
@interface WorkoutExercise : NSManagedObject | |
@property (nonatomic, retain) NSNumber * exercise_uid; | |
@property (nonatomic, retain) NSNumber * order; | |
@property (nonatomic, retain) Exercise *exercise; | |
@property (nonatomic, retain) NSSet *sets; | |
@property (nonatomic, retain) Workout *workout; | |
@end | |
@interface WorkoutExercise (CoreDataGeneratedAccessors) | |
- (void)addSetsObject:(Set *)value; | |
- (void)removeSetsObject:(Set *)value; | |
- (void)addSets:(NSSet *)values; | |
- (void)removeSets:(NSSet *)values; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment