0

I'm trying to get a particle effect across my whole background in storyboards using a SpriteKit view that I added but this keeps making my app crash. I tried to add it by code but this aswell crashed my app and I don't really know what to make out of the error message as I can't find much about it on the internet...

I linked my SpriteKit view with my 'MyParticle.sks' file

Full error message:

2021-06-23 14:23:28.897788+0200 Project-drink[31447:7030317] Metal API Validation Enabled
2021-06-23 14:23:29.348537+0200 Project-drink[31447:7030317] -[SKEmitterNode scaleMode]: unrecognized selector sent to instance 0x6000007b9a40
2021-06-23 14:23:29.356132+0200 Project-drink[31447:7030317] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SKEmitterNode scaleMode]: unrecognized selector sent to instance 0x6000007b9a40'
*** First throw call stack:`0   CoreFoundation                      0x00007fff20422fba __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007fff20193ff5 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff20431d2f +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
    3   UIKitCore                           0x00007fff246f60f1 -[UIResponder doesNotRecognizeSelector:] + 292
    4   CoreFoundation                      0x00007fff204274cf ___forwarding___ + 1455
    5   CoreFoundation                      0x00007fff204297a8 _CF_forwarding_prep_0 + 120
    6   SpriteKit                           0x00007fff3b47b1e4 -[SKView presentScene:] + 268
    7   SpriteKit                           0x00007fff3b47c350 -[SKView initWithCoder:] + 1123
    8   UIFoundation                        0x00007fff23a13ebe UINibDecoderDecodeObjectForValue + 707
    9   UIFoundation                        0x00007fff23a14148 UINibDecoderDecodeObjectForValue + 1357
    10  UIFoundation                        0x00007fff23a13bee -[UINibDecoder decodeObjectForKey:] + 244
    11  UIKitCore                           0x00007fff24be5ead -[UIView initWithCoder:] + 1390
    12  UIFoundation                        0x00007fff23a13ebe UINibDecoderDecodeObjectForValue + 707
    13  UIFoundation                        0x00007fff23a13bee -[UINibDecoder decodeObjectForKey:] + 244
    14  UIKitCore                           0x00007fff242ba159 -[UIRuntimeConnection initWithCoder:] + 160
    15  UIFoundation                        0x00007fff23a13ebe UINibDecoderDecodeObjectForValue + 707
    16  UIFoundation                        0x00007fff23a14148 UINibDecoderDecodeObjectForValue + 1357
    17  UIFoundation                        0x00007fff23a13bee -[UINibDecoder decodeObjectForKey:] + 244
    18  UIKitCore                           0x00007fff242b4f4a -[NSCoder(UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:forKey:] + 443
    19  UIKitCore                           0x00007fff242b7a53 -[UINib instantiateWithOwner:options:] + 1122
    20  UIKitCore                           0x00007fff23f84921 -[UIViewController loadView] + 668
    21  UIKitCore                           0x00007fff23f84cbc -[UIViewController loadViewIfRequired] + 172
    22  UIKitCore                           0x00007fff23eba03a -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 162
    23  UIKitCore                           0x00007fff23eba326 -[UINavigationController _startTransition:fromViewController:toViewController:] + 154
    24  UIKitCore                           0x00007fff23ebb3b8 -[UINavigationController _startDeferredTransitionIfNeeded:] + 876
    25  UIKitCore                           0x00007fff23ebc734 -[UINavigationController __viewWillLayoutSubviews] + 150
    26  UIKitCore                           0x00007fff23e9d04c -[UILayoutContainerView layoutSubviews] + 217
    27  UIKitCore                           0x00007fff24c18c90 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2946
    28  QuartzCore                          0x00007fff27a055b8 -[CALayer layoutSublayers] + 258
    29  QuartzCore                          0x00007fff27a0be3f _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 611
    30  QuartzCore                          0x00007fff27a17c53 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65
    31  QuartzCore                          0x00007fff27951f26 _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 656
    32  QuartzCore                          0x00007fff279893b9 _ZN2CA11Transaction6commitEv + 713
    33  UIKitCore                           0x00007fff246debb8 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 81
    34  CoreFoundation                      0x00007fff20390c74 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    35  CoreFoundation                      0x00007fff20390070 __CFRunLoopDoBlocks + 437
    36  CoreFoundation                      0x00007fff2038aa08 __CFRunLoopRun + 892
    37  CoreFoundation                      0x00007fff2038a1a7 CFRunLoopRunSpecific + 567
    38  GraphicsServices                    0x00007fff2b874d85 GSEventRunModal + 139
    39  UIKitCore                           0x00007fff246c14df -[UIApplication _run] + 912
    40  UIKitCore                           0x00007fff246c639c UIApplicationMain + 101
    41  libswiftUIKit.dylib                 0x00007fff53fcbf42 $s5UIKit17UIApplicationMainys5Int32VAD_SpySpys4Int8VGGSgSSSgAJtF + 98
    42  Project-drink                       0x000000010f314c4a $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 122
    43  Project-drink                       0x000000010f314bbe $s13Project_drink11AppDelegateC5$mainyyFZ + 46
    44  Project-drink                       0x000000010f314ce9 main + 41
    45  libdyld.dylib                       0x00007fff2025abbd start + 1
)
Larme
  • 24,190
  • 6
  • 51
  • 81
  • `scaleMode` is a property of `SKScene`, while it's being called in a `SKEmitterNode` instance. Show the stacktrace, it might help... – Larme Jun 23 '21 at 12:35
  • You mean the first throw call stack? I've added it! – Jef Janssen Jun 23 '21 at 12:46
  • In your ViewController, you have an IBOutlet of type SKsomething? Is it the correct class set to it? – Larme Jun 23 '21 at 12:47
  • Well I did not add a IBOutlet for the SKview, I just added the SKview and linked it to my particle.sks file but have not added code for it atm as I'm using storyboards. when I delete the SKview the app runs fine – Jef Janssen Jun 23 '21 at 12:52
  • Okay so if I remove the link between the SKview and my particle file, it renders the view with the standard grey color and doesn't crash the app, so I guess the problem is with the particle file – Jef Janssen Jun 23 '21 at 13:28

0 Answers0