Hi! I´m getting into objective c programing and I have stumbled across an error I can´t fix..
If I take away the last ";" in the line
The errors goes away and a new one appears in the "if" part
http://gyazo.com/4e23169996ac5ff6fcf9a2ca50a55678
then
http://gyazo.com/4de3a7cb8d56727084f57f085658e426
any idées?
Thanks!
If I take away the last ";" in the line
Code:
completion:^(BOOL finished) {[dmgLabel removeFromSuperview];}];
The errors goes away and a new one appears in the "if" part
Code:
-(void) damageCreep
{
_targetCreep.health -= damage;
UILabel *dmgLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 120, 50)];
[dmgLabel setText:[NSString stringWithFormat:@"-%i", damage]];
[dmgLabel setTextColor:[UIColor blackColor]];
[dmgLabel setBackgroundColor:[UIColor clearColor]];
[dmgLabel setCenter:_targetCreep.creepImgView.center];
[_targetCreep.creepImgView.superview addSubview:dmgLabel];
[[UIView animateWithDuration:1.0
animations:^{[dmgLabel setAlpha:0.0];}
completion:^(BOOL finished) {[dmgLabel removeFromSuperview];}];
if (_targetCreep.health <= 0)
{
//remove from store
[_targetCreep.creepImgView removeFromSuperview];
[[[CreepStore theCreepSore] activeCreeps] removeObject:_targetCreep];
//Stop firing
[self stopFiring];
}
if (CGRectIntersectsRect(_targetCreep.creepImgView.frame, _rangeView.frame) == NO)
{
[self stopFiring];
}
}
http://gyazo.com/4e23169996ac5ff6fcf9a2ca50a55678
then
http://gyazo.com/4de3a7cb8d56727084f57f085658e426
any idées?
Thanks!