Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

PCKInterfaceControllerLoader doesn't initialize/binds IBOutlets and IBActions in XCode 8.3.2 #200

Open
thomas3687 opened this issue May 16, 2017 · 5 comments

Comments

@thomas3687
Copy link

PCKInterfaceControllerLoader doesn't initialize/binds IBOutlets and IBActions from watch storyboard in XCode 8.3.2

My target setup for testing watchOS > 2.0 is the same as in:
https://content.pivotal.io/blog/apple-watch-2-0-with-tdd-setup

When callling:

 - (id)interfaceControllerWithStoryboardName:(NSString *)storyboardName
                                 identifier:(NSString *)objectID
                                     bundle:(NSBundle *)bundle

from PCKInterfaceControllerLoader, it returns the correct WKInterfaceController, but all WKInterfaceObjects in this scene are not initialized.

This issue doesn't occur in XCode < 8.3.2

@tjarratt
Copy link
Contributor

Oof, that's unfortunate that this started to break. First off, thanks for reporting this issue @thomas3687. I've been away from iOS development for a while, and it's cool to hear that people are using PCK (and even finding utility using it with WatchOS!).

Have you had any opportunity to dig into what's happening on Xcode 8.3.2? My best guess is that something deep inside our magic code that handles scene initialization for controllers broke with a new WatchOS toolchain in the latest Xcode 8.3.2, but I haven't spent the time digging in and finding out exactly what's wrong.

@akitchen
Copy link
Contributor

akitchen commented May 16, 2017 via email

@akitchen
Copy link
Contributor

Could this be due to the same root cause as #201 ? The tutorial you mention may no longer be valid now that WatchOS 1.0 has been deprecated.

@koutloup
Copy link

koutloup commented Aug 3, 2017

are there any news on this issue?

@tomquist
Copy link

The problem is that the system framework WatchKit.framework in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/WatchKit.framework is also loaded and NSClassFromString returns the real WatchKit class instead of the shadow class. The real implementation returns nil from [[class alloc] init] which is why all IBOutlets are nil too.

When running unit tests there are lots of warnings on initialization:
Class WKInterfaceObject is implemented in both

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/WatchKit.framework/WatchKit and MyTestBundle.xctest/Frameworks/WatchKit.framework/WatchKit. One of the two will be used. Which one is undefined.`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants