(Réglé) Erreur "this class is not key value coding-compliant for the key previous."
Ben77650
Membre
2014-04-25 16:44:41.298 App[6435:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<OffreViewController 0x109571fe0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key previous.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000101d17495 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101a7699e objc_exception_throw + 43
2 CoreFoundation 0x0000000101d9b919 -[NSException raise] + 9
3 Foundation 0x0000000101657530 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x0000000101d13400 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x000000010087e8a6 -[UINib instantiateWithOwner:options:] + 1131
6 UIKit 0x0000000100718b0c -[UIViewController _loadViewFromNibNamed:bundle:] + 245
7 UIKit 0x0000000100719149 -[UIViewController loadView] + 112
8 UIKit 0x00000001007193b7 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x0000000100719777 -[UIViewController view] + 29
10 App 0x000000010000d65d -[OffreViewController initWithNibName:bundle:] + 2093
11 App 0x000000010002b52c -[HomeViewController page_offre:] + 76
12 UIKit 0x0000000100624f06 -[UIApplication sendAction:to:from:forEvent:] + 80
13 UIKit 0x0000000100624eb4 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 17
14 UIKit 0x0000000100701880 -[UIControl _sendActionsForEvents:withEvent:] + 203
15 UIKit 0x0000000100700dc0 -[UIControl touchesEnded:withEvent:] + 530
16 UIKit 0x000000010065bd05 -[UIWindow _sendTouchesForEvent:] + 701
17 UIKit 0x000000010065c6e4 -[UIWindow sendEvent:] + 925
18 UIKit 0x000000010063429a -[UIApplication sendEvent:] + 211
19 UIKit 0x0000000100621aed _UIApplicationHandleEventQueue + 9579
20 CoreFoundation 0x0000000101ca6d21 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
21 CoreFoundation 0x0000000101ca65f2 __CFRunLoopDoSources0 + 242
22 CoreFoundation 0x0000000101cc246f __CFRunLoopRun + 767
23 CoreFoundation 0x0000000101cc1d83 CFRunLoopRunSpecific + 467
24 GraphicsServices 0x0000000103d48f04 GSEventRunModal + 161
25 UIKit 0x0000000100623e33 UIApplicationMain + 1010
26 App 0x000000010001f923 main + 115
27 libdyld.dylib 0x00000001023af5fd start + 1
28 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Ce qui est étonnant c'est que je n'ai plus rien du nom de "previous" (j'avais mais remplacé par "prevPage"), donc très franchement je ne comprends pas d'ou cela peut venir.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title=@Les offres;
loadingView = [[UIView alloc] initWithFrame:CGRectMake(75, 200, 170, 170)];
loadingView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
loadingView.clipsToBounds = YES;
loadingView.layer.cornerRadius = 10.0;
actview = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
actview.frame = CGRectMake(65, 20, actview.bounds.size.width, actview.bounds.size.height);
[loadingView addSubview:actview];
loadingLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 80, 140, 22)];
loadingLabel.backgroundColor = [UIColor clearColor];
loadingLabel.textColor = [UIColor whiteColor];
loadingLabel.adjustsFontSizeToFitWidth = YES;
loadingLabel.text = @Téléchargement des annonces. Veuillez patientez svp...;
loadingLabel.lineBreakMode = NSLineBreakByWordWrapping;
loadingLabel.numberOfLines=0;
loadingLabel.textAlignment = NSTextAlignmentCenter;
[loadingLabel sizeToFit];
[loadingView addSubview:loadingLabel];
[self.view addSubview:loadingView];
[actview startAnimating];
[self getAllOffers];
_table=@TAB_annonces;
_baseURL = @http://www.fr.monsite.com/images/photos/;
limit=20;
offset=0;
numpage=1;
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
UIView *tfooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ListOffre.frame.size.width, 45)];
tfooterView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
UILabel *labelPage = [[UILabel alloc] initWithFrame:CGRectMake(ListOffre.frame.size.width/2-120, 0, 240, 35)];
labelPage.backgroundColor = [UIColor clearColor];
labelPage.font = [UIFont systemFontOfSize:12];
labelPage.textAlignment = NSTextAlignmentCenter;
NSString *numeroPage;
numeroPage=[NSString stringWithFormat:@Page %d, numpage];
labelPage.text = numeroPage;
labelPage.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
[tfooterView addSubview:labelPage];
UIButton* prev = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 165, 40)];
UIImage* prevImg = [UIImage imageNamed:@precedent.png];
[prev setBackgroundImage:prevImg forState:UIControlStateNormal];
[prev setTitle:@Précédent forState:UIControlStateNormal];
[prev addTarget:self action:@selector(prevPage) forControlEvents:UIControlEventTouchUpInside];
[tfooterView addSubview:prev];
UIButton* next = [[UIButton alloc]initWithFrame:CGRectMake(150, 0, 165, 40)];
UIImage* nextImg = [UIImage imageNamed:@suivant.png];
[next setBackgroundImage:nextImg forState:UIControlStateNormal];
[next setTitle:@Précédent forState:UIControlStateNormal];
[next addTarget:self action:@selector(nextPage) forControlEvents:UIControlEventTouchUpInside];
[tfooterView addSubview:next];
ListOffre.tableFooterView = tfooterView;
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
}
return self;
}
Connectez-vous ou Inscrivez-vous pour répondre.
Réponses
Regarde dans le xib OffreViewController tu verras que y a encore "previous" connecté quelque part.
Bien vu c'était ça merci