image doesn't show when I build the app - objective-c

In Xcode, I am just trying to get an image to show up in my app. I tried taking an image I had previously used in the app and put that into a uiimageview and still, when I build, nothing shows up. I have tried deleting the image file from the app and putting it back in there, I have tried to clean the app and then build. Nothing I am doing works. I just want to be able to put an image in the view and have it show up!

Most propably you're just have a typo in the name of the image - in imageNamed: - it happens sometimes) And it's case-sensitive - so double check the name.

It's possible that the image is not added as a bundle resource. To do this, you should go to your target settings, and then to Build Phases and later check if this image appears in the Copy bundle resources section. If not, add it by pressing the + button at the end of the list.
I don't know why but in the latest Xcode if you add an image, delete it and then add a new one with the same name, this is not added to the Bundle resources.

Please check if your images are added to the target which you are trying to build.
Sometimes, it happens when you have two targets lets say one for DEVELOPMENT and one for TESTING and images are added only at one target.
Please re-check if that is the case.

Related

Wallet pass fails to display if it has no images

I am trying to create an ios Wallet Event Ticket. I managed to give all the info I needed to create the pass.json and I have signed and zipped it. When I try to open this on a Mac, I am able to see the pass in the preview. When I email it and try to open it from an iPhone, the screen just goes to the main screen as if it crashed.
After lots of experimentation I found out that if I add at least one of t he images (icon) I am able to see it in preview and add it to the Wallet.
Since I do not care to add any image, this seems way too much just to make it work.
The question is, are images required in the pass? And if not, why does it not work without them. I repeat, it was displayed on Mac preview either with or without the image file.
Yes! manifest.json required the image correctly, moreover the pass.json also need to ensure everything is correct. Some elements must add in json for iPhone open, for example:serialNumber, webServiceURL, authenticationToken, relevantDate
Also, iPhone open .pkpass as difference format with mac. In my case , the signature file is wrong will also make the .pkpass file cannot open in iPhone.

Invalid Image Path - No Image found AppIcon120x120

I'm using Xcode 6 and Assets Catalogue to manage my App Icons. Or at least so I thought!
I'm trying to validate my Archive, but keep getting this message:
I have an image of 120x120 in the Assets Catalogue under AppIcon (although labeled as CarPlay iOS8). In fact I have lots and lots of images under AppIcon. I know the 120x120 is there. I promise.
To check, I have deleted it. Added it again. Deleted all the AppIcons, added them again. Clean built.
Still the same error message.
I really am at a loss as to know what to do.
I've looked in the plist and there is no mention of CFBundleIcons in there ..
So, any help would be gratefully received.
Remove the CarPlay icon from your AppIcon image assets.
If you actually want or need a 120x120 icon anyway, this can also be fixed by including a 120x120 icon named AppIcon120x120.png in your bundle as a regular file (outside of the asset catalog), in addition to the CarPlay entry in the icon asset.

How to re-allow my app to use the current location

I am using CLLocationManager to find the location.The first time that I run the app for mistake I didn't allow the app to use the current location.
So every time the delegate gets notified through the locationManager:didFailWithError selector.
I tried to make a clean build and to delete the project folder in derived data, but it still doesn't ask me to use the current location.
I would make possibile to re-select through that panel if I would use the location, how is that possibile?
You have to delete the application from the simulator or phone and then run another build onto the device.
I hope I understood you correctly, if I think that this is not a coding issue:
If you are on iOS6, you'll have to allow location services for the app at
Settings > Privacy > Location Services.
For more info, see Apple's documentation here: http://support.apple.com/kb/HT5467?viewlocale=en_US&locale=en_US

NSUserNotification don't show application icon in notification [duplicate]

I'm using OSX's Notification Center APIs for the first time and can't seem to figure out how to make my app's icon to show up in the Notification badge.
The default "your app doesn't have an icon" icon keeps showing up:
Here's what I've done so far
I have created an icns file that includes 512, 256, 128, 32 & 16px versions
dragged the icon into the "App Icon" section of the target's summary
I made to sure to check the box to copy the icon into the project
the plist's "Icon file" section references the correct icon name (minus the .icns) part
Any ideas? The icon doesn't show up when I run the app thru Xcode or when I export an archive either.
I also have extracted the Sparrow.icns file from Sparrow.app and tried using that one instead of the one I made. That didn't work either.
I was able to fix this issue by incrementing the Build number in the General section for the build Target.
You can force the Notification Center to refresh all of the icons by deleting the Notification Center database file (~/Library/Application Support/NotificationCenter/SOME_UUID.db) and then killing the Notification Center process (e.g., from Activity Monitor).
Unfortunately this has the side effect of deleting your notification history, but this wasn't too much of an issue for me.
There's actually an ongoing debate on Apple's developer forums (link, link for people with access) about this. As far as I know, there's currently no real solution, but you can try the following:
Change your app's bundle ID and try it again. If you change it, clean your app, and change back, some people have reported success with seeing their icon show up.
Log in as another user. The caching Notification Center uses may be per-user, so you might be able to get the properly-iconned notifications as a different person.
The folder location has been moved for OSX 10.10+.
Following command takes to you to its new location:
$ cd `getconf DARWIN_USER_DIR`/com.apple.notificationcenter/db
and then
$ open .
Easiest way that I managed to get the icon to show up is change the Bundle Identifier in your project. This works on OSX 10.10.5 and XCode 7.2
(Once notification center picks up the change, you can change it back to your original bundle identifier if you already have a provisioning profile associated with it)
I have solved the issue by archiving my app and adding a copy to my applications folder. When the app is in Application folder, the icon is always visible even you run the app from XCode...
I tried all of the above suggestions but the only thing that worked for me on 10.14 was to delete DerivedData:
rm -rf ~/Library/Developer/Xcode/DerivedData
If anyone still having this issue, and none of the methods above worked, here is how I solved it:
open Notifications from the System Preference (easiest is to open Alfred or spotlight and type Notifications)
find your application and remove it (press backspace/delete button)
NOTE: this may remove all notifications
I am using Xcode 11.5 and I had the same problem. In my case tough, it was sufficient to clean build output, close and reopen the project. Then do a fresh build and let it run again. The icon was there afterwards.
Side note: I've placed the app icon for every size in the assets.xcassets file, except 1024 x 1024 pixels. Don't know if this is relevant or not. Hope that helps.

Adding project to existing one

I have a table view project with multiple controllers and another one that is a image gallery project and have a Three20 project added to it. I found it in internet.
So i want when a table view cell is tapped a image gallery opens. Both projects work fine when i test em separated . I tried dragging gallery project and adding it to my main project ,but and then adding a headers to my project ,but the only thing i got are errors. Any ideas
It's hard to tell you anything, because you didn't mention detailed information of your works. At least, we must know that if you are using XCode 4, what kind of errors you have got! and so on...
Moreover, do you know how to link static library into XCode project. That's the way it should work!