Bonjour, étant débutante dans ce langage j'ai beaucoup cherché et essayé sans résultat. Me voici donc ici.
J'ai 2 classes, Data et CompositeCard. Mon service Restful me permet d'accéder à mes Data en donnant l'id de ma CompositeCard. Cependant Objective-C m'averti qu'il ne fait pas le zapping et je ne comprends pas pourquoi.
Donc je vous affiche mon code en entier et j'espère vraiment que quelqu'un pourra m'aider.

ViewControllerData.h
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
#import <UIKit/UIKit.h>
 
@interface ViewControllerData : UIViewController<UIAlertViewDelegate,RKObjectLoaderDelegate>
{
    UITableView* _tableView;
    NSArray* _data;
}
@end
ViewControllerData.m
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#import "ViewControllerData.h"
#import "Data.h"
#import "CompositeCard.h"
 
@interface ViewControllerData ()
 
@end
 
@implementation ViewControllerData
 
 
- (void)loadTimeline {
    // Charger le modèle via RestKit
    RKObjectManager* objectManager = [RKObjectManager sharedManager];
    objectManager.client.baseURL = [RKURL URLWithString:@"http://localhost:8080/CulturalNetworksMuseumServer/resources"];
    [objectManager loadObjectsAtResourcePath:@"/compositecards/1/artifactcards" delegate:self];
}
 
 
- (void)viewDidLoad
{
    [super viewDidLoad];
 
 
    RKLogConfigureByName("RestKit/Network*", RKLogLevelTrace);
    RKLogConfigureByName("RestKit/ObjectMapping", RKLogLevelTrace);
 
    // Initialisation de RestKit
    RKObjectManager* objectManager = [RKObjectManager managerWithBaseURLString:@"http://localhost:8080/CulturalNetworksMuseumServer/resources"];
 
    // Active la gestion automatique de l'indicateur de l'activité réseau
    objectManager.client.requestQueue.showsNetworkActivityIndicatorWhenBusy = YES;
 
    //Configuration du mappage de l'objet CompositeCard
    RKObjectMapping* compositeMapping = [RKObjectMapping mappingForClass:[CompositeCard class]];
//    [compositeMapping mapKeyPath:@"id" toAttribute:@"cc_id"];
//    [compositeMapping mapKeyPath:@"name" toAttribute:@"cc_name"];  
    [compositeMapping mapAttributes:@"id", @"name", nil];
 
    //[[objectManager mappingProvider] setObjectMapping:compositeMapping forKeyPath:@"/compositecards"];
 
    //Configuration du mappage de l'objet Data
    RKObjectMapping * dataMapping = [RKObjectMapping mappingForClass:[Data class]];
    [dataMapping mapKeyPath:@"id" toAttribute:@"ac_id"];
    [dataMapping mapKeyPath:@"file" toAttribute:@"ac_file"];
    [dataMapping mapKeyPath:@"typefile" toAttribute:@"ac_typefile"];
    [dataMapping mapKeyPath:@"author" toAttribute:@"ac_author"];
    [dataMapping mapKeyPath:@"title_topic" toAttribute:@"ac_title_topic"];
    [dataMapping mapKeyPath:@"year" toAttribute:@"ac_year"];
    [dataMapping mapKeyPath:@"technical" toAttribute:@"ac_technical"];
    [dataMapping mapKeyPath:@"support_media" toAttribute:@"ac_support_media"];
    [dataMapping mapKeyPath:@"format" toAttribute:@"ac_format"];
    [dataMapping mapKeyPath:@"owner" toAttribute:@"ac_owner"];
    [dataMapping mapKeyPath:@"collection" toAttribute:@"ac_collection"];
    [dataMapping mapKeyPath:@"descritpion_remarks" toAttribute:@"ac_descritpion_remarks"];
    [dataMapping mapKeyPath:@"compositeCard" toRelationship:@"ac_compositeCard" withMapping:compositeMapping];
 
 
    // Permet de mapper l'objet artifactCard avec la source de ce dernier
    [objectManager.mappingProvider setObjectMapping:dataMapping forResourcePathPattern:@"/compositecards/1/artifactcards"];
    //[[objectManager mappingProvider] addObjectMapping:dataMapping];
 
    NSString * test = @"Mappage dans la View Controller";
    NSLog(@"%@",test);
 
 
//    // mise en place d'une TableView
//    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 480-64) style:UITableViewStylePlain];
//    _tableView.dataSource = self;
//    _tableView.delegate = self;
//    _tableView.backgroundColor = [UIColor clearColor];
//    _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
//    [self.view addSubview:_tableView];
 
    // appel de la fonction qui charge le modèle
    [self loadTimeline];
 
}
 
#pragma mark RKObjectLoaderDelegate methods
- (void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response
{
    NSLog(@"Loaded payload: %@", [response bodyAsString]);
}  
 
/**
 ** Permet de charger la liste des adresses provenant des services Rest sous forme de tableau
 ** Remplir le tableau _addresses (local) avec le tableau d'objects
 ** Mettre à jour la TableView
 **/
- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects {
    NSLog(@"Load collection of ArtifactCards: %@", objects);
    _data = [NSArray arrayWithArray:objects];
    [_tableView reloadData];
}
 
- (void)objectLoader:(RKObjectLoader*)objectLoader didFailWithError:(NSError*)error {
    UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    NSLog(@"Hit error: %@", error);
}
 
//#pragma mark UITableViewDataSource methods
//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
//    return 1;
//}
//
//- (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section {
//    return [_data count];
//}
//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//    NSString* reuseIdentifier = @"Data Cell";
//    UITableViewCell* cell = [_tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
//    if (nil == cell) {
//        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
//        cell.textLabel.numberOfLines = 0;
//        cell.textLabel.backgroundColor = [UIColor clearColor];
//    }
//    Data *data = [_data objectAtIndex:indexPath.row];
//    
//    //[cell.textLabel setText:[NSString stringWithFormat:@"%@ %@", address.ad_lat, address.ad_lon]];
//    
//    [cell.textLabel setText:[NSString stringWithFormat:@"%@", data.ac_title_topic]];
//    [cell.detailTextLabel setText:[NSString stringWithFormat:@"%@", data.ac_author]];
//    
//    return cell;
//}
 
 
- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}
 
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
 
@end
Data.h
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#import <Foundation/Foundation.h>
#import "CompositeCard.h"
 
@interface Data : NSObject{
NSNumber* _ac_id;
NSString* _ac_file;
NSString* _ac_typefile;
NSString* _ac_author;
NSString* _ac_title_topic;
NSString* _ac_year;
NSString* _ac_technical;
NSString* _ac_support_media;
NSString* _ac_format;
NSString* _ac_owner;
NSString* _ac_collection;
NSString* _ac_descritpion_remarks;
CompositeCard* _ac_compositeCard;
}
 
@property (nonatomic, retain) NSNumber* ac_id;  
@property (nonatomic, retain) NSString* ac_file;
@property (nonatomic, retain) NSString* ac_typefile;
@property (nonatomic, retain) NSString* ac_author;
@property (nonatomic, retain) NSString* ac_title_topic;
@property (nonatomic, retain) NSString* ac_year;
@property (nonatomic, retain) NSString* ac_technical;
@property (nonatomic, retain) NSString* ac_support_media;
@property (nonatomic, retain) NSString* ac_format;
@property (nonatomic, retain) NSString* ac_owner;
@property (nonatomic, retain) NSString* ac_collection;
@property (nonatomic, retain) NSString* ac_descritpion_remarks;
@property (nonatomic, retain) CompositeCard* ac_compositeCard;
 
@end
Data.m
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#import "Data.h"
 
@implementation Data
 
@synthesize ac_id = _ac_id;
@synthesize ac_file = _ac_file;
@synthesize ac_typefile = _ac_typefile;
@synthesize ac_author = _ac_author;
@synthesize ac_title_topic = _ac_title_topic;
@synthesize ac_year = _ac_year;
@synthesize ac_technical = _ac_technical;
@synthesize ac_support_media = _ac_support_media;
@synthesize ac_format = _ac_format;
@synthesize ac_owner = _ac_owner;
@synthesize ac_collection = _ac_collection;
@synthesize ac_descritpion_remarks = _ac_descritpion_remarks;
@synthesize ac_compositeCard = _ac_compositeCard;
 
@end
CompositeCard.m
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
#import "CompositeCard.h"
 
@implementation CompositeCard
@synthesize cc_id = _cc_id;
@synthesize cc_name = _cc_name;
@end

CompositeCard.h
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
#import <Foundation/Foundation.h>
 
@interface CompositeCard : NSObject{
    NSNumber* _cc_id;
    NSString* _cc_name;
}
 
@property (nonatomic, retain) NSNumber* cc_id;  
@property (nonatomic, retain) NSString* cc_name;
 
@end
J'espère que quelqu'un pourra m'aider c'est vraiment très important, c'est pour l'école… merci à ceux qui pourront et voudront m'aider.