1

I have the following code:

 - (void) setConstrainedTransform: (CGAffineTransform) aTransform
{
 imageView.transform = aTransform;
 CGAffineTransform concat;
 CGSize asize = imageView.frame.size;
 if(asize.width > MAXZOOM * originalSize.width)
 {
 concat = CGAffineTransformConcat(imageView.transform, CGAffineTransformMakeScale((MAXZOOM * originalSize.width / asize.width), 1.0f));
 imageView.transform = concat;
 }
}

where MAXZOOM is defined as 2.0f.

The problem is, it shows the following error:

Expected ')' before ';' token;

I tried everything I could think of to solve it, but could not succeeded. Does anyone know what could be causing this error and how I could fix it?

Cody Gray
246k53 gold badges510 silver badges590 bronze badges
asked Jan 14, 2011 at 10:05
5
  • 1
    Please use the code tags Commented Jan 14, 2011 at 10:06
  • what u mean by code tags Commented Jan 14, 2011 at 10:07
  • He means the button at the top of the editing field with curly braces. You can highlight all of your code, then click that button. It will make the code show up properly formatted. I already fixed this post, but now you'll know in the future. Commented Jan 14, 2011 at 10:10
  • Please put the define in the code snippet, too and also tell us where the error is reported (which line). Commented Jan 14, 2011 at 10:12
  • Have a look for errors on you #import files. Commented Jan 14, 2011 at 10:13

2 Answers 2

6

Maybe you have defined the macro with a trailing semicolon?

// v
#define MAXZOOM 2.0f;

If so, remove that and see if the issue persists.

answered Jan 14, 2011 at 10:13
Sign up to request clarification or add additional context in comments.

Comments

4

Just assuming: did you put a ; at the end of the #define ? Remove that, it will be put where you use MAXZOOM.

So instead of

#define MAXZOOM 2.0f;

make it

#define MAXZOOM 2.0f
answered Jan 14, 2011 at 10:14

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.