iOS/Fcm - How to Use Image Name from Payload to Display an Image from Xcasset Folder as Notification Attachment

Can I get a NSURL from an XCAssets bundle?

If you're targeting iOS 7+, Xcode 5 now puts the assets into a new file format. 1 file for all of the assets. This means you can not get access to the file directly.

If you need to access the file directly, you can include it as an normal image outside of an asset catalog.

Use of 'const' for function parameters

The reason is that const for the parameter only applies locally within the function, since it is working on a copy of the data. This means the function signature is really the same anyways. It's probably bad style to do this a lot though.

I personally tend to not use const except for reference and pointer parameters. For copied objects it doesn't really matter, although it can be safer as it signals intent within the function. It's really a judgement call. I do tend to use const_iterator though when looping on something and I don't intend on modifying it, so I guess to each his own, as long as const correctness for reference types is rigorously maintained.



Related Topics



Leave a reply



Submit