SKAction playSoundFileNamed Not Playing Sound on Physical iPad - ios

I am currently on Whack-A-Penguin (Project 14) of Hacking with Swift. I am trying to get the sound to work, but I am unsure of why it is not working. There is no error code that comes up in debugger, which makes it hard to understand what is going wrong...
I am testing on a physical iPad with the sound settings on. Below is a snapshot of where i have placed the files and how the soundfile is being called in my code. Not sure what the issue is...Any help would be greatly appreciated.
Image of my file directory and code snippet

When you select your sound file in XCode, access the inspector on the right side, then make sure the file is selected for your target(s).
Screenshot from Xcode showing where to do this

Related

UE4 Is anyone know why the 4.26.2 ARKit for some devices keeps black?

Is anyone know why UE4.26.2 ARkit for some devices will always keeps black?
I use the Default AR project to test it, for some device with project build from UE4.26.2, the Camera will keeps black, but it can actually detect& tracking the plane, just can't display.
Same project build from UE4.25 for same devices, all works good, is anyone know why this happened?
I'm going to check the source code about the Apple ARKit.
Any hint will be appreciated, thanks in advances!
I finally figure it out with the UE4.26.2 source engine, there are two steps:
Copy the ARkitCameraMaterial from UE4.25 to AppleARKit content folder
Inside "AppleARKitVideoOVerlay.cpp", change the OverlayMaterialPath to the path that "ARKitCameraMaterial" located, then it works on my case
By the way, don't change & re-apply this material, cause there is a function depreciated by UE4.26, but this way takes some time cause need build the source engine, hope it can help you guys!

Xcode doesn't find assets which have been imported before

I try to play music with the AVAudioPlayer of the AVFoundation.
The line triggering the player is this one:
playBackgroundMusic("background-music-aac")
I previously imported the file (.caf) as you can see here:
http://i.stack.imgur.com/UJ3Fr.jpg
Still Xcode can't find it, as you also can see in the image.
When you select the audio file background-music-aac make sure that it will be compiled with your target. Please check if it is selected on your File Inspector on the right hand panel of Xcode.

How to call LazyTableImages in my own project

I am new to IOS development, and I would like to use the LazyTableImages sample in my project. I have main screen displaying a list of menus. What i want to achieve is that when a user clicks a menu on the main screen, it will start a new screen which calls the LazyTableImages code and downloads the images.
But i have no idea how to do that.Because in the sample, the screen with the images is the first window, and in my project, it is not.It seems that I will need to move the LazyTableAppDelegate.h and LazyTableAppDelegate.m to the my own delegate file AppDelegate.h and AppDelegate.m files but i didnt get any luck doing that. Can anyone shed any light how should i make the change? Is there any sample code i can refer how to call one project in the other?
http://developer.apple.com/library/ios/#samplecode/LazyTableImages/Introduction/Intro.html
this links solve your problems.
1) [HJCache][1]
2) [Video Part1][2]
3) [Video Part2][3]

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

Image being loaded before app main method is called

I have an ipad app where I am seeing an image displaying briefly before the app starts (image is part of bundle).
My guess is that this is some wrong wiring of a xib file, but even when I set a breakpoint at the beginning of the main method, the image still appears before this point is reached.
Resetting the simulator does not help, and the scenario occurs on a device too.
Mmmm is the image named Default.png ?
I just don't see an other explanation for this problem ^^
By the way, I just don't use Interface Builder to avoid this kind of strange problems ^^

Resources