thread startermacrumors regular

I don't have the casts in my code, I carelessly put them in my example.

I don't cast any object to the type of self or any of the variables such as the int or (NSPopUpButton *). The calls to [self selector] are in the implementation of the object. Breakpoints are set at offending call to [self selector]. self is a valid allocated object instance with a hex address. XCode finds no problems when building but crashes during execution. This worked with Older versions. XCode seems to be building the project with no problem but failing to recognize the selector at runtime. I'll look at the build settings. Maybe I have some setting like build for 10.8 set and I'm using 10.7. I'll check.

It probably doesn't matter but this project was written with Objective C 1 - no reference counting or ARC.

Please post your actual code, at the point where the error is coming from. That is, at the point where myMethodName:myInt: is actually being messaged.

Your first post had this:

Code:

[self myMethodName: (int) x menu: (NSPopUpButton *) myMenu];

The method signature is myMethodName:menu: . This differs from what's in your error message above, which is myMethodName:myInt: .

Also, your class name in your first post is myClass, yet the class name in the error message is myClassName.

If those are the actual method and class names, then the problem should be clear: you don't have the method you seem to think you do. Why this might be so can only be guessed at without seeing your actual code. It may be an optional method in a protocol. Your code may be doing something unexpected. We don't know, because you have not yet posted your actual code, only a hypothetical. The hypothetical is clearly not the same as what's in the error message, because the methods are clearly different.

If those are not the actual method and class names, then please post the actual unaltered class name, method name, and the actual unaltered error message output.

When you say the build generates no errors, do you mean no errors or warnings? Because you may only be getting a warning.

thread startermacrumors regular

First I changed the names of the parameters so there was no name collision with variables in some .h files for some .c files in the project. I don't think that this was the problem.

Then I carefully copied the parameters, etc. to the method implementations so that the parameters, etc. are exactly the same. This solved the problem. I think that there was a typo in the name of one or more parameter or parameter name. It's surprising that XCode wouldn't catch this and at least give me a warning when I built the project.

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.