Watchkit Extension Test Class - Bad Access Issue

nahzor

I set up a test target for my Watchkit extension by following the steps mentioned in the 'How can I unit test my WatchKit extension?' section in this link.

Then I imported a controller class from the Extension into my test class and tried to create an object for it. This is throwing a EXC_BAD_ACCESS error.

Import statement:
#import "NotificationController.h"

Creating an object:
NotificationController *controller = [[NotificationController alloc] init];

The controller class i imported is a sub class of WKUserNotificationInterfaceController. Could someone tell me what I am doing wrong?

Thanks!

bgilham

This post from Pivotal Labs says they hit a similar issue. http://pivotallabs.com/watchkit-test-tools-pivotalcorekit/

It sounds like using WatchKit classes directly (as you are, even with a subclass) doesn't work. Perhaps try breaking your code out into a separate, testable class and including that in your WKInterfaceController classes.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Xcode - Error launching WatchKit Extension

From Java

iOS WatchOS - what is the difference between WatchKit App and WatchKit App extension?

From Dev

Apple Watch, WatchKit Extension and main application

From Dev

C# class members access issue

From Dev

issue using Azure Mobile Services framework with swift on iOS - EXC_BAD_ACCESS while saving table records to class property

From Dev

Apple Watchkit simulator issue: SPErrorInvalidBundleNoGizmoBinaryMessage

From Dev

WatchKit Extension Bundle ID Unavailable

From Dev

xCode exclude watchkit extension for submitting

From Dev

Access contents of Watchkit extension's host's mainBundle

From Dev

Is there an equivalent class to UIView in WatchKit?

From Dev

`EXC_BAD_ACCESS` in Class implementing KVO

From Dev

WatchKit Extension bundle identifiers

From Dev

Problems with Watchkit Extension NSURLSession in Swift

From Dev

UICollectionView Unit Test Bad Access on dequeueReusableCellWithReuseIdentifier

From Dev

WatchKit Extension Bridging Header errors (in Swift Project)

From Dev

Is it a bad practice to access a class's constant via an instance?

From Dev

Unable to access Inner class issue in java

From Dev

Writing a unit-test for a class extension in Swift

From Dev

C# class members access issue

From Dev

JMImageCache in a simple test app crashes with EXC_BAD_ACCESS

From Dev

Issue with class access specifier

From Dev

Issue Creating Test Class For Trigger

From Dev

WatchKit NSUserDefaults and NSKeyedUnarchiver issue

From Dev

Problems with Watchkit Extension NSURLSession in Swift

From Dev

Reference a Objective c class in my WatchKit extension (swift)

From Dev

Access fields of a TestNG test class from a TestListenerAdapter

From Dev

Issue with class to wrap database access PHP GAE

From Dev

EXC_BAD_ACCESS on method in class

From Dev

Unity Vuforia Extension EXC_BAD_ACCESS with AVCaptureSession

Related Related

  1. 1

    Xcode - Error launching WatchKit Extension

  2. 2

    iOS WatchOS - what is the difference between WatchKit App and WatchKit App extension?

  3. 3

    Apple Watch, WatchKit Extension and main application

  4. 4

    C# class members access issue

  5. 5

    issue using Azure Mobile Services framework with swift on iOS - EXC_BAD_ACCESS while saving table records to class property

  6. 6

    Apple Watchkit simulator issue: SPErrorInvalidBundleNoGizmoBinaryMessage

  7. 7

    WatchKit Extension Bundle ID Unavailable

  8. 8

    xCode exclude watchkit extension for submitting

  9. 9

    Access contents of Watchkit extension's host's mainBundle

  10. 10

    Is there an equivalent class to UIView in WatchKit?

  11. 11

    `EXC_BAD_ACCESS` in Class implementing KVO

  12. 12

    WatchKit Extension bundle identifiers

  13. 13

    Problems with Watchkit Extension NSURLSession in Swift

  14. 14

    UICollectionView Unit Test Bad Access on dequeueReusableCellWithReuseIdentifier

  15. 15

    WatchKit Extension Bridging Header errors (in Swift Project)

  16. 16

    Is it a bad practice to access a class's constant via an instance?

  17. 17

    Unable to access Inner class issue in java

  18. 18

    Writing a unit-test for a class extension in Swift

  19. 19

    C# class members access issue

  20. 20

    JMImageCache in a simple test app crashes with EXC_BAD_ACCESS

  21. 21

    Issue with class access specifier

  22. 22

    Issue Creating Test Class For Trigger

  23. 23

    WatchKit NSUserDefaults and NSKeyedUnarchiver issue

  24. 24

    Problems with Watchkit Extension NSURLSession in Swift

  25. 25

    Reference a Objective c class in my WatchKit extension (swift)

  26. 26

    Access fields of a TestNG test class from a TestListenerAdapter

  27. 27

    Issue with class to wrap database access PHP GAE

  28. 28

    EXC_BAD_ACCESS on method in class

  29. 29

    Unity Vuforia Extension EXC_BAD_ACCESS with AVCaptureSession

HotTag

Archive