Je déclare une classe Skin en tant que variable sur mon AppDelegate. Je ne l'ai jamais assigné là-bas mais plus tard dans l'application c'est comme si le pointeur avait été réutilisé par un autre code. J'ai plusieurs déclarations mais pour une raison quelconque l'élément toolBarTint semble être réaffecté (aléatoirement) d'un type différent lorsque j'utilise le débogueur au point d'utilisation plus tard dans mon application, dans le cas actuel UISectionRowData (mais change à chaque fois) . Je ne cède pas à n'importe où ailleurs dans mon application.La propriété de classe change le type sans affectation
@interface Skin : NSObject {
UIColor *navigationTint;
UIColor *searchBarTint;
UIColor *toolBarTint;
UITableViewStyle tableViewStyle;
CGFloat tableViewCellHeight;
UIColor *tableViewBackgroundColour;
MKPinAnnotationColor *pinColour;
NSString * locationViewFontName;
CGFloat locationViewFontSize;
}
@property (nonatomic,assign) UIColor *navigationTint;
@property (nonatomic,assign) UIColor *searchBarTint;
@property (nonatomic,assign) UIColor *toolBarTint;
@property (nonatomic,assign) UITableViewStyle tableViewStyle;
@property (nonatomic,assign) CGFloat tableViewCellHeight;
@property (nonatomic,assign) UIColor *tableViewBackgroundColour;
@property (nonatomic,assign) MKPinAnnotationColor *pinColour;
@property (nonatomic,retain) NSString * locationViewFontName;
@property (nonatomic,assign) CGFloat locationViewFontSize;
@end
- délégué App définir la peau
skin = [[Skin alloc] init];
skin.navigationTint = [UIColor colorWithRed:((float) 154/255.0f) green:((float) 98/255.0f) blue:((float) 176/255.0f) alpha:1.0f];
skin.searchBarTint = [UIColor colorWithRed:((float) 154/255.0f) green:((float) 98/255.0f) blue:((float) 176/255.0f) alpha:1.0f];
skin.toolBarTint = [UIColor colorWithRed:((float) 154/255.0f) green:((float) 98/255.0f) blue:((float) 176/255.0f) alpha:1.0f];
skin.tableViewStyle = UITableViewStyleGrouped;
skin.tableViewCellHeight = 60.0;
skin.tableViewBackgroundColour = [UIColor colorWithRed:((float) 154/255.0f) green:((float) 98/255.0f) blue:((float) 176/255.0f) alpha:1.0f];
skin.pinColour = MKPinAnnotationColorRed;
skin.locationViewFontName = @"Helvetica";
skin.locationViewFontSize = 15.0f;
+1 pour 'retain' au lieu de' assign' –