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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:24:34+00:00 2026-05-18T02:24:34+00:00

Okay, I am having a hard time with this. I’ve searched for the past

  • 0

Okay, I am having a hard time with this. I’ve searched for the past hour on it and I don’t get what I am doing wrong. I’m trying to take the currentTitle of a sender, then convert it to an integer so I can use it in a call to list.

NSString *str = [sender currentTitle];
NSInteger *nt = [str integerValue]; // this is where the error appears //
NSString *nextScreen = [NSString stringWithFormat:@"Screen_%@.jpg", [screenList objectAtIndex:nt]];

I assume it’s something with the [str integerValue] bit not being properly used, but I can’t find an example that works.

Thanks!

  • 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-18T02:24:35+00:00Added an answer on May 18, 2026 at 2:24 am

    Let’s analyze the error message:

    Initialization (NSInteger nt) makes pointer (*) from integer ([str integerValue]) without a cast.

    This means that you are trying to assign a variable of non-pointer type ([str integerValue], which returns an NSInteger) to a variable of pointer type. (NSInteger *).

    Get rid of the * after NSInteger and you should be okay:

    NSString *str = [sender currentTitle];
    NSInteger nt = [str integerValue]; // this is where the error appears //
    NSString *nextScreen = [NSString stringWithFormat:@"Screen_%@.jpg", [screenList objectAtIndex:nt]];
    

    NSInteger is a type wrapper for the machine-dependent integral data type, which is defined like so:

    #if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64
    typedef long NSInteger;
    typedef unsigned long NSUInteger;
    #else
    typedef int NSInteger;
    typedef unsigned int NSUInteger;
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay this is my first WPF app and I am having a hard run
Okay so im having a hard time saving the state of my activity so
Okay, I'm having one of those weird moments trying to get the file modified
Okay so I am having this problem. I write up a script to be
Okay, I seem to be having a problem. I'm trying to create a twicker
Okay, I feel a bit foolish for having to ask this but I guess
Okay guys, basically the problem I'm having is this. I've been assigned to write
Hi I am having an incredibly hard time with what should be a simple
I'm having a bit of a hard time. Essentially I need a data structure
Okay so this query should be easy but I'm having a bit of difficult.

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.