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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:08:13+00:00 2026-06-04T18:08:13+00:00

I was making a basic method that takes a Flickr image URL and returns

  • 0

I was making a basic method that takes a Flickr image URL and returns the image’s ID.
I’m passing the method the NSString @"http://farm6.staticflickr.com/5183/5629026092_c6762a118f".

The goal is to return the int: 5629026092, which is in the image’s URL and is the image’s ID.

Here is my method:

-(int)getImageIDFromFlickrURL:(NSString *)imageURL{
    NSArray *objectsInURLArray = [imageURL componentsSeparatedByString:@"/"];
    NSString *lastObjectInFlickrArray = [objectsInURLArray lastObject];
    NSArray *dirtyFlickrIdArray = [lastObjectInFlickrArray componentsSeparatedByString:@"_"];
    NSString *flickIDString = [dirtyFlickrIdArray objectAtIndex:0];
    NSLog(@"flickr id string: %@",flickIDString);
    int flickrID = [flickIDString intValue];
    NSLog(@"id: %i",flickrID);
    return flickrID;
}

The output in the console is:

2012-05-26 13:30:25.771 TestApp[1744:f803] flickr id string: 5629026092
2012-05-26 13:30:25.773 TestApp[1744:f803] id: 2147483647

Why is calling intValue deforming the actual number?

  • 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-04T18:08:16+00:00Added an answer on June 4, 2026 at 6:08 pm

    Use long long instead, your number is greater than int can handle (max being 2147483647 as you can see in your second log)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a basic Palindrome Checker in python for a small project. I have
I am making a basic platform game for the iPhone and I have encountered
I am making a basic little game in Java and I want to have
so I'm making some basic programming language (just for exercise). I've made simple grammar
So I recently followed this tutorial on making a basic chatroom in Java. It
I was just refreshing my JavaScript/Jquery skills and I thought of making a basic
I am making a very basic webpage, consisting of some text inside a fixed
I'm making a very basic menu but I can't seem to get it to
I'm making a very basic menu for my site and I have used the
I'm sorry for maybe making such a basic question but in ASP.NET websites what

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.