Coming
Coming

Reputation: 11

xcode jump to wrong definition

I have a file named SysConfig.h and its has the following function

+ (void)setValue:(NSString*) key float:(float) value;

When I use this function in AppDelegate.m like

[SysConfig setValue:@"AA" float:1.0];

and select "setValue" to jump to its definition, Xcode jumps to UISlider.h

@property(nonatomic) float value; 

When debugging the program step by step, I cannot step into some of the functions that created by me. Even cleaning the project didn't help. Does anyone have any ideas? My code is executable and works fine in Xcode 5.0. However, when I upgrade to Xcode 5.1, that problem happened.

Tested on Xcode 5.1, iOS SDK 7.1

Update:

When I refactor->Rename the setValue to setFloatValue, and click jump to definition, it becomes "Symbol Not Found"

Upvotes: 1

Views: 910

Answers (1)

Rich
Rich

Reputation: 8202

There's a setter for value on UISlider so I imagine Xcode is just picking that up. You could try renaming the method and see if the problem still happens?

It might be clearer to name it

+ (void)setFloatValue:(CGFloat)value forKey:(NSString *)key;

Anyway as it then follows the usual Objective-C convention. As your original definition seems to use the value and key interchangeably!

Upvotes: 1

Related Questions