开发者

Overridden UIPickerView instantiated on simulator but not on device

In my project I have a subclass A of a UIPickerView.

In Interface Builder I have a UIPickerView whose type I have changed to my subclass A.

In another class B, also defined in my code, instantiated in Interface Builder and linked to A vi开发者_如何学JAVAa its outlet, it refers to A with an IBOutlet field A *mySubclass.

The problem is this:

When running on the simulator it works fine; A breakpoint on B’s awakeFromNib confirms that mySubclass has been loaded and is indeed of type A. When running on the device (iOS4.1 on iPhone 4) however, the same breakpoint reveals that mySubclass is now of type UIPickerView.

Adding an awakeFromNib to subclass A confirms that when running on the simulator A’s awakeFromNib gets called but not when running on the device.

Has anyone any idea why this might be?

Thanks in advance for any help,

Teo


An update:

After a couple of days of trying everything I eventually started trying some example projects on the device (which worked) and finally created a new project with the intention of migrating the code across in case the project itself had somehow gotten broken.

Having named the new project the same as the problematic one I noticed I couldn’t run it because of an UDID mismatch.

This caused me to have a look at the apps on the device through the Xcode organizer and noticed I had two of the same app on there. Deleting those made everything work again. Sigh. Glad it's sorted but if anyone has any idea exactly what happened I'd love to hear it.

Thanks for the eyeballs and sorry for asking an impossible problem although anyone reading this might now try removing the offending app from their device sooner rather than later.

Best, Teo

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜