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 8787281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:51:11+00:00 2026-06-13T21:51:11+00:00

I have a next button that I want to disappear when I get to

  • 0

I have a next button that I want to disappear when I get to the last result of an array and I want my previous button to disappear when I am at the first result of the array. I have figured out how to make them disappear when only one result is found.

Contacts is the array.

next Button:

        //button look
if (contacts != nil) { 
    if ([contacts count] > 1 ) [self.view addSubview:nextButton];

Previous button:

       //button look
if (contacts != nil) { 
    if ([contacts count] > 1 ) [self.view addSubview:previousButton];

I have tried this

if ([contacts count] < (index-1)) [self.view addSubview:nextButton];

I get this error “Ordered comparison between pointer and integer (‘NSUInterger'(aka ‘unsigned int’) and ‘char * (*)(const char *,int)’)” The button is there it just doesn’t disappear when it gets to the last result.

Any help would be greatly appreciated.

  • 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-06-13T21:51:12+00:00Added an answer on June 13, 2026 at 9:51 pm

    It sounds like index is a NSUInterger. count is a int and NSUInteger is typedef to unsigned integer. try changing index where ever your setting it to a int or typecasting it to a int where your using it for comparison.

    For the part about the button, if your logic is right and you are trying to remove “nextButton” from view you can either hide or remove it from the view like so:

    // To remove button
    if ([contacts count] < (index-1)) [nextButton removeFromSuperview]; 
    

    or

    //To hide button
    if ([contacts count] < (index-1)) nextButton.hidden = YES;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want the next and prev buttons to have two uses. First: the standard
I have a button that I want to function like normal, except I don't
i have a button that says Next and everytime i click it, it that
I have a button that performs an ajax post -- I want to disable
I have a button next to a text box and when I click the
I have a textbox with an 'Add to clipboard' button next to it. Whenever
I have an EditText and a Button set next to each other on the
I have an anchor tag <a class=next>next</a> made into a button. Sometimes, this tag
This is what I want: Let's say I have a textbox and a button
How can I create a button that will scroll to the next jQuery tab.

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.