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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:49:17+00:00 2026-05-24T10:49:17+00:00

I saw several people on SO have been using this code successfully. But I

  • 0

I saw several people on SO have been using this code successfully. But I got the incompatible block pointer error:

Incompatible block pointer types initializing

void(^)(struct ALAssetsGroup *, BOOL *)

with an expression of type

void(^)(ALAsset *, NSUInteger, BOOL *)

Any hints? (EDIT with complete code)

    ALAssetsLibrary *library =[[ALAssetsLibrary alloc]init];
    void (^assetEnumerator)(struct ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop){
    if(result != NULL) {
                NSLog(@"See Asset: %@", result);

            }
        };

    void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) =  ^(ALAssetsGroup *group, BOOL *stop) {
            if(group != nil) {NSLog(@"dont See Asset: ");
                [group enumerateAssetsUsingBlock:assetEnumerator];
            }
        };

    [library enumerateGroupsWithTypes:ALAssetsGroupAlbum
                               usingBlock:assetGroupEnumerator
                             failureBlock: ^(NSError *error) {
                                 NSLog(@"Failure");
                             }];

enter image description here

  • 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-24T10:49:18+00:00Added an answer on May 24, 2026 at 10:49 am

    OK, newbie at blocks… but I found another example of an asset group enumerator block on here, and it didn’t have struct in the declaration. I tried removing it from the code above, and it still works fine and doesn’t have the error message. Hopefully someone who understands struct better can explain?

    try changing this line:

    void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) 
                = ^(ALAssetsGroup *group, BOOL *stop)
    

    to this:

    void (^assetGroupEnumerator)(ALAssetsGroup *, BOOL *) 
                = ^(ALAssetsGroup *group, BOOL *stop)
    

    I think the bottom line is that the ALAssetsLibrary enumerateGroupsWithTypes: usingBlock: expects a block looking like (ALAssetsGroup *, BOOL *) not (struct ALAssetsGroup *, BOOL *).

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

Sidebar

Related Questions

I saw this several times when browsing.. people are using @Inject annotation with their
What is this?: document.getElementById(+id+) I have seen this used several times in code on
After several plugins got updated yesterday I saw in the source code that actually
Saw this piece of code in a Ruby on Rails book. This first one
I saw this same question for VIM and it has been something that I
I have made this mistake several times, and found myself referencing This Post every
In several JavaScript libraries I saw this notation at the very beginning: /** *
I've tried several things, but none of them work... I have Form that should
I have read several of the post about Objective-C method syntax but I guess
I have seen several other posts with similar questions but nothing exactly like 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.