내 AppDelegate에서 스킨 클래스를 변수로 선언합니다. 나는 포인터를 다른 코드에 의해 재사용 된 것처럼 응용 프로그램에서 나중에 거기에 할당합니다.클래스 '속성이 할당없이 타입 변경
여러 가지 선언이 있지만 어떤 이유로 toolBarTint 항목이 내 응용 프로그램의 나중에 사용 시점에 디버거를 사용할 때 (임의로) 다른 유형으로 재 할당 된 것처럼 보입니다 (현재의 경우 UISectionRowData에서 변경 될 때마다) . 내가 할당하지 않는 곳은 내 앱에 있습니다. 대리인에 그런
[skin addObserver:self forKeyPath:@"toolBarTint" options: NSKeyValueObservingOptionNew context:NULL]
@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
앱의 대표는
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 –