1

I am working on a Sprite Kit Game. Things were working fine until out of nowhere, Xcode decided to stop loading a particular sprite image and return this in the Console Log:

Error loading /System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib:  dlopen(/System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib, 262): no suitable image found.  Did find:
/System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib: mach-o, but not built for iOS simulator
2015-11-25 15:26:07.435 Project3[5843:800423] Cannot find function pointer IOHIDLibFactory for factory 13AA9C44-6F1B-11D4-907C-0005028F18D5 in CFBundle/CFPlugIn 0x7fba686b5a50 </System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin> (bundle, not loaded)
2015-11-25 15:26:07.435 Project3[5843:800423] Error loading /System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib:  dlopen(/System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib, 262): no suitable image found.  Did find:
/System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib: mach-o, but not built for iOS simulator
2015-11-25 15:26:07.436 Project3[5843:800423] Cannot find function pointer IOHIDLibFactory for factory 13AA9C44-6F1B-11D4-907C-0005028F18D5 in CFBundle/CFPlugIn 0x7fba686b5a50 </System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin> (bundle, not loaded)
2015-11-25 15:26:07.436 Project3[5843:800423] Error loading /System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib:  dlopen(/System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib, 262): no suitable image found.  Did find:
/System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib: mach-o, but not built for iOS simulator
2015-11-25 15:26:07.436 Project3[5843:800423] Cannot find function pointer IOHIDLibFactory for factory 13AA9C44-6F1B-11D4-907C-0005028F18D5 in CFBundle/CFPlugIn 0x7fba686b5a50 </System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin> (bundle, not loaded)

The code I used to add the image was:

self.superball = [SKSpriteNode spriteNodeWithImageNamed:@"sbstore2.png"];
    self.superball.position = CGPointMake(CGRectGetMidX(self.frame)-200,CGRectGetMidY(self.frame));
    [self addChild:self.superball];

What should I do to resolve this error? I'm using Xcode 7.1.1, and this was first noticed after I upgraded to this.

master45
  • 50
  • 1
  • 9

1 Answers1

0

I do not think it is a bug. As KnightOfDragon said you shouldn't include extention then using ImageNamed, and also i recommend to use Clean

self.superBall = [SKSpriteNode spriteNodeWithImageNamed:@"sbstore2"];

Instead of using initializer above you can just set texture of your node.

self.superBall.texture = [SKTexture textureWithImageNamed:@"sbstore2"];

Or even runnig action to change texture.

[self.superBall runAction:[SKAction setTexture:[SKTexture textureWithImageNamed:@"sbstore2"]]];

If none of this work, you should double check is your image name is correct. If you are adding just by dragging to project make sure you check add to targets and Destination: copy items if needed

Also here is more info about these errors: Mystery console error with IOHIDFamily

Community
  • 1
  • 1
Darvas
  • 974
  • 3
  • 14
  • 27
  • It seems to work now. Thanks! Although I have used extensions in my code since Xcode 5, and it has worked fine then. Why shouldn't extensions be used? – master45 Nov 26 '15 at 06:48
  • https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/index.html#//apple_ref/doc/uid/TP40006890-CH3-SW10 On iOS 4 and later, if the file is in PNG format, it is not necessary to specify the .PNG filename extension. Prior to iOS 4, you must specify the filename extension. – Darvas Nov 26 '15 at 06:51
  • @master248 you can use extension, but you do not have to. – Darvas Nov 26 '15 at 06:54
  • Thanks for clearing that up. The console is still returning the errors, but the image appears now. It's possible that it was just misplaced because I also changed its position. I looked into the Mystery console error with IOHIDFamily question. http://stackoverflow.com/questions/29785320/mystery-console-error-with-iohidfamily before coming here though. – master45 Nov 26 '15 at 07:05
  • In my older project i have it too, it do not make any difference, i even submitted that app and it was aproved. – Darvas Nov 26 '15 at 07:13