Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6842507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:06:32+00:00 2026-05-27T00:06:32+00:00

In following line I get the warning expected identifier before ‘[‘ token gestureRecognizer.[pictureElement piece].transform

  • 0

In following line I get the warning “expected identifier before ‘[‘ token”

gestureRecognizer.[pictureElement piece].transform =
CGAffineTransformScale(gestureRecognizer.[pictureElement
piece].transform, gestureRecognizer.scale, gestureRecognizer.scale);

I guess it is a stupid mistake but I am sitting here for hours not finding the problem.
In the following you see the whole method

- (IBAction)pinchDetected:(UIPinchGestureRecognizer *)gestureRecognizer
{ 
    if (gestureRecognizer.state == UIGestureRecognizerStateBegan || gestureRecognizer.state == UIGestureRecognizerStateChanged)
    {
        gestureRecognizer.[pictureElement piece].transform = CGAffineTransformScale(gestureRecognizer.[pictureElement piece].transform, gestureRecognizer.scale, gestureRecognizer.scale); 
        [gestureRecognizer setScale:1];  
    }
}

UPDATE
If I forgot to add a bracket, it would be more than one warning.

2nd Update
pictureElement is a class and piece is the attribute of the class.
So I want the Gesture react on the attribute piece of my class pictureElement.
PictureElement inherits from UIView and piece is a instance of UIView

3rd Update
I think there is nothing wrong in my gestures, because if I add self.view instead of [pictureElement piece] my screen starts to move and to react on my gestures

Thank you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:06:33+00:00Added an answer on May 27, 2026 at 12:06 am

    The gestureRecognizer.[pictureElement piece].transform = doesn’t make sense. Things of the form x.y = z, where x is an object instance, translate into [x setY:z] or something very similar at compile time — i.e. a message setY:z is sent to instance x.

    Not sure exactly what you’re trying to do, but is the case that the gestureRecognizer. part is spurious and shouldn’t be there? The following code would perhaps make more sense (although wouldn’t necessarily be correct):

    - (IBAction)pinchDetected:(UIPinchGestureRecognizer *)gestureRecognizer
    { 
        if (gestureRecognizer.state == UIGestureRecognizerStateBegan || gestureRecognizer.state == UIGestureRecognizerStateChanged)
        {
            [pictureElement piece].transform = CGAffineTransformScale([pictureElement piece].transform, gestureRecognizer.scale, gestureRecognizer.scale); 
            [gestureRecognizer setScale:1];  
        }
    }
    

    As a side note on style matters, consider sticking consistently to either dot notation (x.y) or message-passing notation ([x y]) in any one place when you’re dealing purely with properties. For example, instead of writing:

    [pictureElement piece].transform = thing
    

    you could stick to all dot notation, like so:

    pictureElement.piece.transform = thing
    

    or you could make it all message-passing format, like so:

    [[pictureElement piece] setTransform:thing]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Xcode I get a warning in the following line for FBConnect: _orientation =
In the following program, the line 5 does give overflow warning as expected, but
I can't seem to get rid of this warning for the following line of
I have a unit test which contains the following line of code Site.objects.get(name=UnitTest).delete() and
When trying to validate my site, I get the following error: Line 188, column
I am getting the following error when I get to the line that invokes
I want to use svn command line with beyond compare and get the following
Running the following code, I get a StackOverflowError at the getPackage() line. How can
I get the warning childNodes is null or not an object' with different line
i have the following line of code which displays the following warning: HashMap<String,String> currentItem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.