Problem description is brief but I think I don't need to say much. When I load my custom movie player's .xib
, the UIButton/UIBarButtonItem controls are set to ivars/properties of my File's Owner
object, and they also have their actions/selectors set to various local methods. The function is never entered (gdb breakpoint not hit).
I've verified setView:
and set...Button:
are being called (haven't investigated whether they're nil yet). I also tried manually calling addTarget:action:forControlEvents:
/setAction:
upon UI initialisation, to no avail.
There's extra oddness here too: the buttons actually highlight, and then stay highlighted. So they transition from UIControlStateNormal
to UIControlStateHighlighted
(/UIControlStateSelected
, depending on how single taps roll), but upon the UIControlEventTouchUpInside
which would otherwise trigger the action of the button, the button seems to remain in its highlighted/selected state.
Note that the following controls in the same .xib
work without issue:
MPVolumeView
(Apple-subclassedUISlider
)UISlider
(with selectors set for theUIControlEvent
sValueChanged
,TouchDown
,TouchUpInside
,TouchUpOutside
,TouchCancel
, all of which seem to be working still)UIGestureRecognizer
s (even single tap ones on buttons currently work)
This used to work, so what's changed in the .xib
since then? Well:
- Now using an AVPlayerLayer as the
layerClass
of the top-level view (hence the top-level view is also a subclassedUIView
). This was to fix some movie loading dodginess/visual lag.
That's literally all that's changed, at least that I can think of.. I've tried removing and reconnecting the outlets in IB too. Thoughts which are not necessarily solutions are also welcomed!
EDIT: Okay, so here's an overview of which devices it's working/broken in. Simulator not tested because I have .a
libraries which only have the armv6
/armv7
architectures compiled in.
- iPhone 3G on 4.2.1 (8C148) jailbroken with PwnageTool 4.2, baseband version
05.15.04
, no SIM inserted: Buttons not firing - iPad 1 on 4.3.5 (8L1), baseband version
07.11.01
, SIM inserted: Buttons are firing - iPad 2 on 5.0b4 (9A5274d), no baseband (it's WiFi-only): Buttons not firing
- iPhone 4 on 4.3.4 (8K2), SIM inserted: Buttons are firing
I've tried deploying to devices 1 and 2 from both iOS 4.3 (Xcode 4.0.2 4A2002a) and iOS 5.0b4 (Xcode 4.2 4C139), same results in both instances (phone doesn't work, pad works). I've also tried completely uninstalling the app from devices 1 and 2 AND doing a clean build, same results on reinstall. Device 3 I deployed to from Xcode 4.2 only and device 4 from Xcode 4.0.2 only.
Only correlation I can see there is no cell signal = not working, but that's nonsensical. I turned cell data off on device 2 just in case, but it's still working fine over WiFi.