More "request for member in not a structure or union" errors
I'm using coocs2d and I get the title errors when commented. I imported UIKit into my header.
-(void)timerLoad:(NSTimer *)timer {
timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(timerLoad:) userInfo:nil repeats:YES];
if (loadingBar.loading) { //error
[activity stopAnimating];
}
else {
[activity startAnimating];
}
if (loadingBar.loading = NO) { //error
activity.HIDDEN = YES; //thanks ;)
}
}
loadingBar is a CCProgressTimer and activity is a UIActiv开发者_C百科ityIndicatorView
Have you imported the CCProgressTimer.h
header file into this implementation file? If all you do is a forward declaration (@class CCProgressTimer
) then it tells the compiler that a class with that name exists, but it doesn't tell the compiler about the class' properties. You must have the header imported for dot syntax (loadingBar.loading
) to make sense to the compiler.
(Also, UIView
has a hidden
property, not a visible
property.)
try to forward declare your controller class in your view class's .h file
@class yourcontroller
@interface yourview....
hope it helps
精彩评论