IOS: multiple language xcode 5 for launch image - ios

I have a problem, what's the way to organize localized launch images in xcode 5, is there a way to do it?
thanks

SOLVED!!!!
Set in plist file "Launch image" in "Default"
and have two file for launch image in the project as
Default-Landscape#2x~ipad and Default-Landscape#~ipad
that you can localize as another file...

Yes, you have a way to do that. Looks like you can get an idea to your answer here in this post of StackOverflow Question.
Please do check the answer posted here. That is more close to your question.

Actually, you can create a temp ViewController and you can put a UIImageView on your View. After launch your program you can direct to this temp ViewController and set the image according to your language. than you can call your main ViewController.
And i used this class for change the language in my program.
https://github.com/tonisalae/TSLanguageManager
I hope, it can be help for you.

Related

how does LaunchScreen.storyboard redirect to Main.storyboard

I'm newbie of iOS developer, and I know that is very simple question but I really can't understand reason.
when I build SingleViewApplication, Xcode auto generate LaunchScreen.storyboard and Main.storyboard,
but I can't find any code like [self.navigationController pushViewController:] which may choose that what view controller enter stack as last one of top-level view,
I only find ViewController.{h,m} as first and see no logic that change view from LaunchScreen.storyboard to Main.storyboard.
could anyone help? thanks..
Main.storyboard file and LaunchScreen is define in your project property.
you can find it by click on project in xcode and then in below target you can find this two name you can choose your own by selecting dropdown given beside label.
and other redirecting to LaunchScreen to Main.storyboard you can refer info.plist file in your project and also AppDelegate.h and AppDelegate.m
Most probably the iOS first looks for LaunchScreen.storyboard file and shows it for some time and when it is done with it, it looks for Main.storyboard.
These names are hardwired in the plist as mentioned by Tejas in his answer and you can change these.
I don't think the the LaunchScreen.storyboard is pushing the Main.storyboard. Everything is managed behind the scenes and you can't change this behavior.
What you can change is the initial View Controller in your Main.storyboard so that it is instantiated immediately after the LaunchScreen.storyboard disappears and the app is fully loaded.

My two word app name is being displayed as one word

I have my app name set to 'Random Game' but for some reason on the launch screen it is displaying as 'RandomGame'. I know it's kind of small but it's really bugging me. This is my Xcode project:
And this is how it's coming out:
That looks like two words to me, just the text has been squashed a bit because your name is long. See what it looks like if you change it to "Rand Game".
Check you Info.plist. Be sure that your bundle display name is set to "Random Game".
Open launchscreen.storyboard and make the changes.

Trouble in Internationalisation, iOS

I need to internationalize some of the labels in a screen; do I need to localize the whole screen?
One more doubt, I have taken a string file and pulling the value of the keys from that file directly from that file using NSLocalizedString, then also do I need to localize the screen or it will by default get localized?
Thanks in advance.
you need not to localize the whole screen.
for two label only, on viewdidLoad
self.lbe1.text = NSLocalizedString(#"Label1", nil)
self.lbe2.text = NSLocalizedString(#"Label2", nil)
your second doubt is not clear to me.
You have to create the localize file. Then label you can use the localized id. Then you don't need to worry the whole screen or particular screen or particular text. Because whatever you can change. If you want more info refer this link
http://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014

iOS - from code to storyBoard

can i generate automatically storyBoard from existing code?
If not, does someone know a good way to make the connection between the current code and new storyBoard?
Thanks in advance!!
can i generate automatically storyBoard from existing code?
No, you can't.
You will have to analyze what the code does, and translate it into the new storyboard. Or you can simply use XIB files, this way different persons can tackle different parts of the application, without risking too many conflicts when committing the code.
Add a new Storyboard to you project like the pic below :
and then set its target from Summary -> iPhone/iPodDeployment Info :
However this is just to make a new MainStoryBoard for your app.

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