Warning - used as the name of the previous parameter, and not as part of the selector

I am using a function in the class as shown below

- (void) uploadMorePic:(NSDictionary *) MuliPics: (NSData *)file 

A warning is displayed here - MuliPics , used as the name of the previous parameter, and not as part of the selector

Why is this happening?

Screenshot for example

+8
objective-c xcode
source share
3 answers

This is a bad message, but this is because you did not specify a name for the first parameter for your method. Try the following:

 -(void)uploadMorePic:(NSDictionary *)dict muliPics:(NSData *)file 

I also fixed the style issue; the name of the second part of the method name must begin with a lowercase letter. I don't know what your method does, so you can come up with a better name.

+14
source share

Since you did not separately specify the parameter name and selector definition. Basically, you are missing a space and / or word. Try:

 -(void)uploadMorePictures:(NSDictionary *)pics withFile:(NSData *)file 

Which separately defines and sets both parameters for the method.

+5
source share

@dpassage is a good answer.

The name of the objective-c function is not like C or C ++, it has some parameter and the same amount of parameter name description. In your case, you did not specify the name of your first parameter or you did not specify your description of the second parameter name.

What @dpassage meant was the first condition, the missing name of the first parameter.

0
source share

All Articles