Je suis en train de faire deux sous-classes d'une classe:Classes SuperClasses Sous-classes
// Old code
- (void)setPaging {
[pagingScrollView addSubview:self.ImageScrollView];
}
@interface ImageScrollView : UIScrollView <UIScrollViewDelegate> {
UIView *imageView;
NSUInteger index;
}
@property (assign) NSUInteger index;
- (void)displayTiledImageNamed:(CGPDFPageRef)page size:(CGSize)imageSize;
@end
@implementation ImageScrollView
@synthesize index;
// ... my methods ...
@end
à Changé:
// NEW Code__________________________________________________________*
- (void)setPaging {
if (D == 1) {
// error: request for member 'ISVportrate' in something not a
// structure or union
[pagingScrollView addSubview:self.ISVportrate];
} else if (D == 2) {
//error: request for member 'ISVLandscape' in something not a
// structure or union
[pagingScrollView addSubview:self.ISVLandscape];
}
}
@class ISVportrate;
@class ISVLandscape;
@interface ImageScrollView : UIScrollView <UIScrollViewDelegate> {
UIView *imageView;
NSUInteger index;
}
@property (assign) NSUInteger index;
- (void)displayTiledImageNamed:(CGPDFPageRef)page size:(CGSize)imageSize;
@end
@interface ISVportrate : ImageScrollView {}
@end
@interface ISVLandscape : ImageScrollView {}
@end
@implementation ISVportrate : ImageScrollView
// error: property 'index' attempting to use ivar 'index' declared in
// super class of 'ISVportrate'
@synthesize index;
// ... my methods ...
@end
@implementation ISVLandscape : ImageScrollView
// error: property 'index' attempting to use ivar 'index' declared in
// super class of 'ISVLandscape'
@synthesize index;
// ... my methods ...
@end
Je ne fais pas ce droit, suis-je? voir ci-dessus J'ai 4 erreurs ... c'est la première fois que j'ai fait un cours ... aidez-moi à comprendre, je pense que j'ai presque raison.
Quel langage de programmation est-ce? Pour l'avenir, s'il vous plaît mentionner le langage de programmation au moins dans les balises, mais de préférence aussi dans le poste de question lui-même. – Timwi
On dirait Objective-C pour moi. –
iphone sdk xcode objc LOL désolé maaaaate! : P – user422241