Error in VowelMovement typedef

When I change the VowelMovement program to include the typedef…

[code]#import <Foundation/Foundation.h>

typedef void (^ArrayEnumerationBlock) (id, NSInteger, BOOL *);

int main(int argc, const char * argv[]) {
@autoreleasepool {

//Create array of strings and a container for "devowelized" strings.
    
    NSArray *originalStrings = @[@"Sauerkraut", @"Raygun", @"Big Nerd Ranch", @"Mississippi"];
    NSLog(@"original strings: %@", originalStrings);
    
    NSMutableArray *devowelizedStrings = [NSMutableArray array];
    
//Create a list of characters to be removed from the string.
    
    NSArray *vowels = @[@"a", @"e", @"i", @"o", @"u"];
    
//Declare the block variable.

    ArrayEnumerationBlock devowelizer;
    
//Compose a block and assign it to the variable.
    
    devowelizer = ^(id string, NSUInteger i, BOOL *stop)
    {
        NSRange yRange = [string rangeOfString:@"y" options:NSCaseInsensitiveSearch];

//Did I find a "y"?
        
        if (yRange.location != NSNotFound) {
            *stop = YES; //will prevent further iterations
            return;
        }
        
        NSMutableString *newString = [NSMutableString stringWithString:string];
        
//Iterate over the array of vowels, replacing occurances of each with an empty string.
        
        for (NSString *s in vowels) {
            NSRange fullRange = NSMakeRange(0, [newString length]);
            [newString replaceOccurrencesOfString:s withString: @"" options:NSCaseInsensitiveSearch range:fullRange];
        }
             [devowelizedStrings addObject: newString];
    };
    
//Iterate over the array with your block
    
    [originalStrings enumerateObjectsUsingBlock:devowelizer];
    NSLog(@"devowelized strings: %@", devowelizedStrings); 
}
return 0;

}
[/code]

I get an error “Incompatible block pointer types assigning to ‘__strong ArrayEnumerationBlock’ (aka ‘void (^__strong)(__strong id, NSInteger, BOOL *)’) from ‘void (^)(__strong id, NSUInteger, BOOL *)’” Is this an iOS 8 thing?

thanks

Nothing to do with iOS 8. Look at the error very carefully to see what went wrong.

[quote]typedef void (^ArrayEnumerationBlock) (id, NSInteger, BOOL *); [/quote]
Change the above typedef to:

typedef void (^ArrayEnumerationBlock) (id, NSUInteger, BOOL *);

[Accelerate your learning and become a competent programmer: pretty-function.org]

Right. Thanks ibex. must. read. more. carefully.

Hi GUY ,I have the same problem,could you help me??#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here…
/原始数组/
NSArray*orignalStrings=@[@“Sauerkraut”,@“xiaopei”,@“dichen”,@“ronghua”,@“zhaochao”];
NSLog(@“orignal strings:%@”,orignalStrings);

    NSMutableArray*devowelizedStrings=[NSMutableArray array];
    
    NSArray*vowels=@[@"a",@"o",@"e",@"i",@"u"];
    
    
    
    /* 编写 block对象 */
    
  void (^devowelizer)(id,NSInteger,BOOL *);
    
    devowelizer= ^(id string, NSInteger i,BOOL *stop)
   
    {
        NSMutableString*newString=[NSMutableString stringWithString:string];
        for(NSString*s in vowels)
        {
            NSRange fullRange=NSMakeRange(0, [newString length]);
            [newString  replaceOccurrencesOfString:s withString:@"" options:NSCaseInsensitiveSearch range:fullRange];
        
        }
        [devowelizedStrings addObject:newString];
    };
    
    
   /*NSArray*oldStrings=[NSArray arrayWithObjects:@"Sauerkraut",@"xiaopei",@"dichen",@"ronghua",@"zhaochao" ,nil];
    NSLog(@"old strings %@",oldStrings);
    NSMutableArray*newStrings=[NSMutableArray array];*/
    
   /*NSArray*vowels=[NSArray arrayWithObjects:@"a",@"o",@"e",@"i",@"u" ,nil  ]; 重复定义*/
    
    /*传递Block对象*/
    [orignalStrings enumerateObjectsUsingBlock:devowelizer];
    NSLog(@"new strings:%@",devowelizedStrings);
    
}
return 0;

}

Hi Guy ,I have the same problem,but I read it carefully,I can not find my issue, can you help me ,thanks.
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here…
/原始数组/
NSArray*orignalStrings=@[@“Sauerkraut”,@“xiaopei”,@“dichen”,@“ronghua”,@“zhaochao”];
NSLog(@“orignal strings:%@”,orignalStrings);

    NSMutableArray*devowelizedStrings=[NSMutableArray array];
    
    NSArray*vowels=@[@"a",@"o",@"e",@"i",@"u"];
    
    
    
    /* 编写 block对象 */
    
  void (^devowelizer)(id,NSInteger,BOOL *);
    
    devowelizer= ^(id string, NSInteger i,BOOL *stop)
   
    {
        NSMutableString*newString=[NSMutableString stringWithString:string];
        for(NSString*s in vowels)
        {
            NSRange fullRange=NSMakeRange(0, [newString length]);
            [newString  replaceOccurrencesOfString:s withString:@"" options:NSCaseInsensitiveSearch range:fullRange];
        
        }
        [devowelizedStrings addObject:newString];
    };
    
    
   /*NSArray*oldStrings=[NSArray arrayWithObjects:@"Sauerkraut",@"xiaopei",@"dichen",@"ronghua",@"zhaochao" ,nil];
    NSLog(@"old strings %@",oldStrings);
    NSMutableArray*newStrings=[NSMutableArray array];*/
    
   /*NSArray*vowels=[NSArray arrayWithObjects:@"a",@"o",@"e",@"i",@"u" ,nil  ]; 重复定义*/
    
    /*传递Block对象*/
    [orignalStrings enumerateObjectsUsingBlock:devowelizer];
    NSLog(@"new strings:%@",devowelizedStrings);
    
}
return 0;

}

Sorry,I get it. NSUInteger!!!