-(void)loadEvents{
NSLog(@"sdfsdf");
//obtain the theatreType and place it into a string
NSString *theatre = [NSString stringWithFormat:@"/test/%@.json", self.theatreType];
RKObjectMapping *objectMapping = [RKObjectMapping mappingForClass:[WhatsonEvent class]];
[objectMapping mapKeyPath:@"nid" toAttribute:@"nid"];
[objectMapping mapKeyPath:@"title" toAttribute:@"title"];
[objectMapping mapKeyPath:@"poster" toAttribute:@"poster"];
[objectMapping mapKeyPath:@"by" toAttribute:@"by"];
[objectMapping mapKeyPath:@"by_name" toAttribute:@"byName"];
[objectMapping mapKeyPath:@"summary" toAttribute:@"summary"];
RKObjectManager* manager = [RKObjectManager objectManagerWithBaseURL:@"http://mydomain.com/t_new/js-api"];
[manager loadObjectsAtResourcePath:theatre objectMapping:objectMapping delegate:self];
}
此方法位于我要将检索到的数据加载到的tableViewController
中。此tableViewController
有三个实例将被推送到导航控制器。现在,问题是只有推送的第一个实例才会检索数据。如果我推动其他两个实例没有任何反应;该方法触发,但我没有得到任何RK代表(didLoadObjects
或didFailWithError
)的回复。我在这做错了什么?
RKOBjectMapping
不应该有三个不同的实例,因此每次都有效吗?
修改
我在手机上试了一下它实际上工作了一次。也许,它很慢还是悬挂?