iOS Objective-C blocks warning: Control reaches end of non-void function -
i trying use objective-c blocks. have method:
- (void *)getobjectswithsuccess:(void (^)(nsarray *objectives))success failure:(void (^)(nserror *error))failure; { nsmutablearray *objects = [[nsmutablearray alloc] init]; nsstring *url = [url_constant]; nsdictionary *parameters = @{@"username" : username_constant, @"password" : password_constant}; afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; [manager post:url parameters:parameters success:^(afhttprequestoperation *operation, id responseobjects) { (id responseobject in responseobjects) { nsstring *title = [responseobject objectforkey:@"title"]; nsstring *description = [responseobject objectforkey:@"description"]; object *object = [[object alloc] init]; objective.title = title; objective.description = description; [objects addobject:object]; } success(objects); } failure:^(afhttprequestoperation *operation, nserror *error) { failure(error); }]; }
when xcode builds method, getting warning: control reaches end of non-void function
where ind of non-void function? far understand, method void...
in method return pointer void (void *)
.
therefore, method expecting return pointer void @ end of function.
change (void) , should fine.
edit
although edited question don't believe still have same problem snippet. try see if have (void *)
in code well.
Comments
Post a Comment