CUICatalog: Invalid Request: requesting subtype without specifying idiom - ios

Whenever I run my sprite kit app this error is logged constantly. It makes it really hard to debug because the log is filled with these messages. They don't seem to effect how the app runs, so simply suppressing the error would be sufficient. Anyone have any idea how to fix this?

I think that it's just a left over debug message that hasn't been cleaned up in iPod/iPhone devices.
In my app, the issue seems to be related to using Sprite Atlases in an xcassets file.
if I initialise a sprite with:
SKTexture(imageNamed: "Sprite")
I get the message; However, using the following:
SKTextureAtlas(named: "Atlas").textureNamed("Sprite")
I do not get the message.
Also, any sprites created in an .sks file will display the error, as you have no opportunity (or need) to define an atlas.

I agree that this is an bug in SpriteKit. I'll share what solved it for me.
I was keeping my image assets within a folder inside Assets.xcassets:
Like all the images in my project, I was loading the images as textures like so:
myTexture = SKTexture(imageNamed: "iPhoneX")
This was causing the error message to appear in my console. As suggested in Darren Branford's answer, I tried doing it the following way instead:
myTexture = SKTextureAtlas(named: "MyTextureAtlas").textureNamed("iPhoneX")
But the error messages still appeared. My solution was to remove all those images from the folder within Assets.xcassets, delete the folder, and keep all the images individually at the top level of Assets.xcassets:
The error messages no longer appeared after this. Granted, I would prefer to organize the images in Assets.xcassets using folders like I was doing before. But this is a rather small project with not many images, so I can live with it. In a larger project with lots of image assets, I can see how this would be much more of a problem. Hopefully Apple will fix this bug someday.
Aside:
It may be of interest to note that the console warnings did not appear when creating the SKTexture using one of these images. What triggered the warning was when I ran the texture's size() method and assigned the result to an SKSpriteNode's size property:
size = texture!.size()

Related

MTLTexture only showing one color of the image

I was following raywenderlich's Metal tutorial, but got stuck rendering a texture on a plane, it seems to be showing only one color of the image, not the entire image. I'm running on an iPad iOS 12.3.
Here's a repo for the project: https://github.com/TheJoseph-Dev/MyMetalProgram
May anyone help me?
In your Renderer implementation, set a breakpoint on the line that reads:
private lazy var device = metalView.device
And run your code.
At the point in which this line is executed, the metalView exists, but the device on that metalView is nil. Similar problems can be seen for the other lazy properties of the renderer.
You may wish to use a less complex property style as it appears the properties are not being collected when the view is in the state you expect. I suspect that the view will not create resources like its device until it is attached to a window which will happen after viewDidLoad.

Object disappear from Scene

I use SceneKit to construct a 3D Scene, which contains a few object. I convert all the COLLADA file and OBJ file to SCN file. Then I use a blank SCN file to put all the object together.
It looks fine in SceneEditor. And it runs on iPad. Everything looks exactly like it was in the SceneEditor.
Then I come up with some idea with the scale of one object. I change it in the property bar. It looks nice at the SceneEditor. And I tried to run it again.
Then boooom.
There was only one object left in the scene. Everything was gone. I can see all the object on SceneEditor. They just not show up on my iPad.
This happens all the time -- after I change any property of any object on the scene, the scene went wrong.
So far I was trying to build a new SCN file again with all those objects. But as the project gets bigger this might be a nightmare.
What is going on? Do you guys have any solution?
UPDATE:
I've notice that the Full Path of the normal SCN files I add in the scene look like: "/xxx.scn". But after some editing, it automatically changed to "xxx.scn" without slash. I think this may be the reason why objects disappear. The wrong path leads to nil and BANG.
Everytime when I use "Quick View" it will automatically change the Full Path. Even if I don't do anything.
I tried to relocate the file but the Full Path stay with no slash. PLS someone help me with it.

SpriteKit Memory Leak on static Menu scene

Im experiencing memory leak on static menu scene, it appears that it happens on every scene, game scene itself but also static menu/gameover. Memory appears to be deallocated correctly (and it's reduced when scene is gone).
Those static scenes does not conatins even update callback defined.
It's all setup in didMoveToView and inside it there are couple SKLabelNodes and SKSpriteNode allocated with spriteNodeWithImage.
I have tried to use dealloc to monitor if scene got's deallocated correctly, and it appears to be so it seems it's not the source of the issue.
Browsing google pointed me to some other threads created on stackoverflow that
spriteNodeWithImage
textureWithImage
May cause
-Memory leaks
-weird error "CUICatalog: Invalid Request: requesting subtype without specifying idiom"
So i have tried to create UIImage imageNamed and then put in into texture and use in SKTexture, actually it has removed CUICatalog error (which anyway, seems like a stupid message which did not been removed by apple - can anyone confirm that ?)
But according to memory leaks this didn't help at all, and anyway anything in that scene is being created once on beginning so i have no idea why this memory keeps growing and growing like 0,5mb per sec.
Looking forward for any tips.
Best regards
Actually i have found the source of the problem.
It seems debugging physics makes huge memory leak
skView.showsPhysics = YES;
It's not a big problem since it happens while debugging only when showsPhysics=YES.
But good to know anyway.

Multiple UIImageViews with same image gives Inconsistency error

I add 3 UIImageView objects to a MainViewController.
For each of them add the same image "test.png".
The images display correctly for each of the controls.
Close the MainViewController and reopen it.
You get an error displayed saying "The MainViewControllre" has 3 internal inconsistencies that were found and repaired.
The details for the message indicates that there are resources with the same name.
Although the images still display correctly and the program executes in the simulator I would like to solve this message.
This seems to be something that was introduced in XCode 5.
Sounds like you might be using StoryBoards for setting these images? I remember hearing about this issue a few months ago. Check out this SO post:
Storyboard Internal Inconsistencies
Seems like it may have been a bug in an early release of Xcode 5. The correctly marked answer here states updating to Mavericks and Xcode 5.0.1 fixed the issue. Also, if this in fact the problem, and you can not update for what ever reason, removing the storyboard references to the images and adding the image to the image view programmatically may solve your issue. Trivial example, but just in case you (or anyone else reading this) doesn't know:
[imageView setImage:[UIImage imageNamed:#"imagename.png"]];

Could not load the image referenced from a nib in the bundle with identifier

I had got an iPad application.The ViewContrtoller.xib has got an UIImageView in it. The UIImage of the UIImageView is set through Interface Builder. When I run the application in simulator everything is fine. But when I am trying to run it in iPad the UIImage is not loaded. The message that I am getting is:
HexaPuzzle1.0[3259:207] Could not load the "start.png" image referenced from a nib in the bundle with identifier "com.yourcompany.HexaPuzzle1-0"
2010-12-17 10:57:27.221 HexaPuzzle1.0[3259:207] HexaPuzzle loaded
Any help would be appreciated and will be a great help for me.
The issue has been rectified.
Problem was with the image format. When the image has been edited and saved as PNG-24 everything goes fine.
The application now runs smoothly in simulator and device.
Thanks for all friends who suggested a solution and tried to helped me.
Regards,
Rupesh R Menon
I know it's very late, but this is a solution that also works in Xcode 5, and therefore likely to be useful to people who have this problem in the future.
I have seen a lot of questions like this on the web but none of them seems to have one clear answer. This is, as far as I know, the solution for this problem:
Go to the image in Xcode (no need to re-add or re-generate the
image)
click "show the file inspector"
Make sure the checkbox in the category "Target Membership" is checked. the test check box does not have to be checked to make your app load the image.
The target membership tab looks like this:
if this is already the case, you are working with a broken or damaged file. to rule this out, check if another app (like photoshop) can open your image.
This should do it, hope it helps!
When dragging your start.png file into your project, did you check this option?
I was getting this error in the simulator after upgrading to Xcode 7 / iOS 9 and opening an existing project. The image was present and named correctly, within an XCAssets package.
Turns out the problem was with a parameter within the XCAssets package.
Changing Render As from Default to Original Image solved the problem:
I've had the same problem before. The png file format is not right. Try re-generate the png image file and the problem will be solved.
None of the above worked for me, and the message I got was "could not load the "(null)" image referenced... which means I could not look for the image. Very frustrating. In the end it became a trial and error exercise of going through every xib and storyboard looking for potential conflicts. I finally found it - I had specified a "Selected Image" for a tab bar item which was not needed. As soon as I got rid of that the problem went away.
None of these things work for me. I created a new folder in the projects where I placed the pictures. That worked for me.
This problem was fixed when I changed "add folder reference..." to "add group..." when I import the images to my project. I'd prefer to have folders with live updating, but at least it works now.
Had an image on a XIB (which is replaced by the correct one in code). After finishing this XIB, I renamed the images. So XIB was now referencing a non-existent image.
There is also another potential cause of this problem: If you upgraded to XCode 5 and use both the image asset catalog and "normal" images copied to your project (like you did prior XCode 5). If you then have images with identical names (e.g. "dog.png" and a image set called "dog") it might work in your storyboard and in the simulator, but you'll get this message when run on a real device (where the image will not be shown).
Try moving the images directly to the Resources directory (not in a sub folder)
Make sure the resource isn't too big to be handle.
If you get the error message with the name of the picture, you can search it inside your project and xCode will display immediately the UIImageView with the wrong picture inside UIStoryboard:
Make sure it is included in your Target Membership
Select your "Images.xcassets" file in the file Inspector
Open File Inspector (cmd + opt + 1)
Select your target membership (Usually 1st line)
I had the same problem, but the cause was very different. I was using image sets in the Asset Catalog that varied based on the device idiom: iPad or iPhone.
The framework target they were being added to had been accidentally marked as as having a deployment device type of iPhone, so the images weren't showing up on iPads - they weren't even being copied into the .car file in the framework.
Setting the deployment device type to Universal, as it should have been, solved the problem.
For some reason I was getting error until I put the image in the Assets.xcassets

Resources