AlexR
AlexR

Reputation: 5634

What is wrong with this block declaration?

This is how I declare my completion block as a property:

typedef void(^completionBlock)(NSManagedObjectID *companyID, NSError *error);
@property (strong, nonatomic) completionBlock block;

When calling it with

self.completionBlock(self.company.objectID,self.error)

from within a method I get a compiler error in Xcode:

Too many arguments to block call, expected 0, have 2

What Did I miss?

Thank you!

Upvotes: 0

Views: 1052

Answers (1)

Fonix
Fonix

Reputation: 11597

isnt block the variable here? so you should be going self.block(self.company.objectID,self.error)

Upvotes: 3

Related Questions