2017-03-21 6 views
1

最近私は、私が作業を停止したときに、パイントでそれはまだ正常に動作していた私の古いアプリをチェックアウトしました。しかし今では私がUIImage *newを定義するたびにエラーExpected unqualified-idが出ます。以下Objective-C++エラー:Ex unqualified-id

は方法である:

- (void)endTorsoWithUIImageView:(UIImageView *)flipper andError:(NSError *)clothingManagerError { 
    currActiveCol.torsoCurrCol = (direction == 1)? currActiveCol.torsoCurrCol + 1 : currActiveCol.torsoCurrCol - 1; 
    [clothingManager notifyAboutMovementInSection:ECOSTorso inDirection:(direction == 1)? ECCDNext : ECCDPrevious]; 

    if (direction == 1) { 
     if (currActiveCol.torsoCurrCol + 2 < [[clothingManager.sectionSetSizes objectAtIndex:0] intValue]) { 
      flipper = [[sectionMatrix objectAtIndex:0] objectAtIndex:(currActiveCol.torsoCurrCol + 2) % 4]; 
      [flipper setHidden:YES]; 
      [flipper setCenter:(direction == 1)? CGPointMake(self.view.bounds.size.width + self.outfitView.frame.size.width, flipper.center.y) : CGPointMake(0 - self.outfitView.frame.size.width, flipper.center.y)]; 
      [flipper setHidden:NO]; 

      ECChangeDirection dir = (direction == 1)? ECCDNext : ECCDPrevious; 
      UIImage *new = [clothingManager updateAfterChangeInDirection:dir forSection:ECOSTorso withError:&clothingManagerError]; 
      if (new != NULL) { 
       [flipper setImage:new]; 
       [flipper setFrame:CGRectMake(flipper.frame.origin.x, flipper.frame.origin.y, flipper.frame.size.width, [self ratifierForImage:new])]; 
       [self centerImageView:flipper forFocus:ASTorso takingLoctionIntoAccount:NO forLocation:0]; 
       [[imageAssetCollection objectAtIndex:0] replaceObjectAtIndex:(currActiveCol.torsoCurrCol + 2) % 4 
                   withObject:new]; 
      } else { 
       // TODO: Report error to google analytics 
      } 
     } 
    } else if (direction == -1) { 
     if (currActiveCol.torsoCurrCol - 2 >= 0) { 
      flipper = [[sectionMatrix objectAtIndex:0] objectAtIndex:(currActiveCol.torsoCurrCol - 2) % 4]; 
      [flipper setHidden:YES]; 
      [flipper setCenter:(direction == 1)? CGPointMake(self.view.bounds.size.width + self.outfitView.frame.size.width, flipper.center.y) : CGPointMake(0 - self.outfitView.frame.size.width, flipper.center.y)]; 
      [flipper setHidden:NO]; 

      UIImage *new = (UIImage *)[clothingManager updateAfterChangeInDirection:(direction == 1)? ECCDNext : ECCDPrevious               forSection:ECOSTorso                   withError:&clothingManagerError]; 
      if (new != NULL) { 
       [flipper setImage:new]; 
       [flipper setFrame:CGRectMake(flipper.frame.origin.x, flipper.frame.origin.y, flipper.frame.size.width, [self ratifierForImage:new])]; 
       [self centerImageView:flipper forFocus:ASTorso takingLoctionIntoAccount:NO forLocation:0]; 
       [[imageAssetCollection objectAtIndex:0] replaceObjectAtIndex:(currActiveCol.torsoCurrCol + 2) % 4 
                   withObject:new]; 
      } else { 
       // TODO: Report error to google analytics 
      } 
     } 
    } 
} 

- (UIImage * _Nullable)updateAfterChangeInDirection:(ECChangeDirection)direction forSection:(ECOutfitSection)ecos withError:(NSError * _Nullable * _Nullable)error;が次のようにメソッドの定義です。メソッド自体には特定のイメージを返す問題はありません。イメージが存在しない場合はNULLを返します。

私は本当に失われており、本当にヒントになります。

+0

「new」を変数名として使用しないでください。そしてあなたのUIImageはNULLではなく、無しでチェックします。 https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingIvarsAndTypes.html –

+1

それでした!どうもありがとうございます!それを答えとして追加すると、私はそれを答えとしてマークします。もう一度、ありがとう! – jniegsch

+0

私はそれが助けてうれしいよ:) –

答えて