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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:40:15+00:00 2026-06-11T17:40:15+00:00

Just updated xcode to 4.5 and I’m receiving an error in one of my

  • 0

Just updated xcode to 4.5 and I’m receiving an error in one of my iOS apps which I wasn’t getting previously. Problem was not occurring before the update.

Basically, I have an array that needs sorting, based on some other irrelevant tests..

NSArray *sortedArray = [arrayFiles sortedArrayUsingComparator:^(id a, id b) {
    NSString *first = [(PPFile*)a name];
    NSString *second = [(PPFile*)b name];

    if ([a isFileAvailableForRead] && ![b isFileAvailableForRead]) {

        return  NSOrderedAscending;
    }else if(![a isFileAvailableForRead] && [b isFileAvailableForRead]) {

        return  NSOrderedDescending;
    }

    return [first compare:second];

}];

The error is on the last return of the block:

     Return type 'NSComparisonResult' (aka 'enum NSComparisonResult') must match previous type 'NSInteger' (aka 'int') when block literal has unspecified explicit return type

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-06-11T17:40:16+00:00Added an answer on June 11, 2026 at 5:40 pm

    You forgot the return value type:

    NSArray *sortedArray = [arrayFiles sortedArrayUsingComparator:^NSComparisonResult(id a, id b) {
        < your code>
    }];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just updated my django to 1.4. But I am getting the following error
I ´ve just updated to Xcode 4.2 with iOS 5 and my older projects
I have just updated my iPhone to iOS 5.0.1 and XCode doesn't recognize it
Just updated to latest xCode 4.41 and now I'm getting a ton of warnings
I just updated Xcode to the latest version 4.2. Only problem is that when
I just updated my xcode to 4.3.3 and it starts giving me this error
I've just updated to Xcode 4.0.2 and I have a project which builds a
I have just updated my Xcode to X.Y.Z. Now I have a problem with
I just updated to use XCode 4 and got the following error when running
I've just updated Xcode 4.5 via the App Store, from my previous version which

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.