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

  • SEARCH
  • Home
  • 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 567355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:04:27+00:00 2026-05-13T13:04:27+00:00

In the following code: _imageView.hasHorizontalScroller = YES; _imageView.hasVerticalScroller = YES; _imageView.autohidesScrollers = YES; NSLog(@scrollbar?

  • 0

In the following code:

_imageView.hasHorizontalScroller = YES;
_imageView.hasVerticalScroller = YES;
_imageView.autohidesScrollers = YES;

NSLog(@"scrollbar? H %p V %p hide %p", 
      &(_imageView.hasHorizontalScroller), 
      &(_imageView.hasVerticalScroller),
      &(_imageView.autohidesScrollers));

I’m getting the error:

Controller.m:143: error: lvalue required as unary '&' operand
Controller.m:144: error: lvalue required as unary '&' operand
Controller.m:145: error: lvalue required as unary '&' operand

Notice that I am USING those variables as lvalues directly before the & lines…

How can it complain that a value isn’t an lvalue right after I assign to it with no error? does this have to do with the magical getters/setters that objective C creates?

I think I need to explain some context to explain WHY I’m trying to get the address:

in my previous SO post, I showed the same code, printing %d and finding that after the assignments, the properties were still 0 for some reason. So, I figured I’d try to get the addresses of the properties to see where they’re being stored and maybe I can figure out why I’m not successfully assigning to them, and then this happened.

I think that as people have mentioned, yeah, it’s probably that when I do the assigment obj-c is secretly replacing that with a call to the setter (and then some other magic because in another SO post, someone else mentioned that

BOOL b = [_imageView setHasVerticleScroller: YES]

fails, but

BOOL b = _imageView.hasVerticalScroller = YES;

works fine.

  • 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-13T13:04:27+00:00Added an answer on May 13, 2026 at 1:04 pm

    _imageView.hasHorizontalScroller = YES; – in this line you access property in imageView – so you do not actually access value, but call setter method:

    [_imageView  setHasHorizontalScroller:YES]; // Equivalent of your code.
    

    In second example you also access property, but this time getter method gets called and returns BOOL. So as mipadi points you do not need to use & in that NSLog statement.

    I’d suggest to read docs about properties in obj-c.

    Edit: here you can find the discussion about why properties work in multiple assignment statements like you mentioned:

    BOOL b = _imageView.hasVerticalScroller = YES;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 314k
  • Answers 314k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try adding a "Width" property value and "Float:Left" property value… May 13, 2026 at 11:09 pm
  • Editorial Team
    Editorial Team added an answer As Kobi wrote, eval might be a good option. Alternatively,… May 13, 2026 at 11:09 pm
  • Editorial Team
    Editorial Team added an answer Check the MySQLdb Package Comments: "Parameterization" is done in MySQLdb… May 13, 2026 at 11:09 pm

Related Questions

Can someone please explain why the following code causes my app to bomb? NSData
I am running the following code in tableView:cellForRowAtIndexPath: File *file = [[File alloc] init];
I'm trying to get images to display in a WPF ListView styled like a
Note: I'm using iPhone SDK 3.0 Final Version for Leopard. I need to prepare
I have following code in my application: // to set tip - photo in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.