Troubleshooting with internationalisation - ios

I recently added other language support to my ios project.
Then, I continued to develop.
Now if I turn my language back to English it runs an older (way older) version of the app and I don't know why since the storyboard and code are all correct in the project.
Any hint?

if I turn my language back to english it runs an older (way older) version of the app
This sort of thing is often caused by having old files lying around in the built app, even if they have been changed in the project. Try following my instructions for cleaning the caches and getting rid of all copies of the build app, here:
https://stackoverflow.com/a/6247073/341994

Related

Xcode editor taking too much time in compiling

I'm a newbie in Swift. I just created a new single view project in xcode9.3 and tried building it and its taking forever to compile.
Why is this so?
I have had something similar to this, and I found that restarting Xcode a few times should solve the problem.
If this doesn't work, you might want to download the latest version of Xcode. As of now, I think the latest non-beta version is 9.4.1.
Had the same issue in the past.
The swift compiler have some issues with specific code styles which makes it sometimes compile files even slower.
In the end we quit Swift as a development language and moved to React Native and back to Objective-C on iOS projects as swift became too cumbersome.
Moving forward, you might want to look at some of guides out there.
This two looks promising.
https://medium.com/rocket-fuel/optimizing-build-times-in-swift-4-dc493b1cc5f5
https://github.com/fastred/Optimizing-Swift-Build-Times
Back when I was working on swift, this was guide we were using as a guideline:
Part 1
Part 2

MergJSON LiveCode External for iOS standalone setup

Currently we are only testing LiveCode 7.0.4 to see how it works and if we want to even use it. In our apps we need JSON from our server and have setup the mergJSON library/External in Livecode. So far, this is working very nicely in standalone tests for both MacOS and Windows. Today I started doing some simple tests on iOS and I am having a hard time with it.
I found answers where we need to use the Copy Files section in Standalone Settings, and that we need to copy the *.lcext file for mergJSON. Also watched the youtube how-to video that had mergSettings. There are no .nib files for mergJSON. Only .so, .dylib, and .dll, and the .lcext. I tried to add the .bundle file like the video, but the app will not launch, only black screen. Are other files required for mergJSON? And where do we put them? Do they stay in the same Externals folder structure or in project folder. Also, does an IOS runtime folder need to be created like in Widows/Mac? The app runs, no errors, but no JSON results are returned. I guess I am just a little confused on the Externals setup for iOS.
Just quick notes of our environment. We have Xcode 6.2 and the iOS Sdk 8.2. Live Code is 7.0.4 GPL (just testing and learning this way for now, will purchase commercial once I learn more.) I think the mergJSON I have is 1.0.15, downloaded from mergext.com. (which appears to be offline today) I have only tested on the simulator.
Thanks for any help.
You only need to include the lcext file in the copy files section of standalone settings. No need to setup a runtime folder for iOS etc.

In Xcode, why does a specific Deployment Target break my code, and how should I use it?

Some background info: Syntax color/highlighting and auto-suggest stopped working correctly. I read a lot of questions about how to fix this but none of them helped me as they were related to Derived Data.
I'm learning Swift from some online tutorials, and noticed my syntax highlighting was different to that of the course teacher's. Then I noticed that when I create an instance of my struct, and use the dot syntax after the instance, Xcode didn't auto-suggest the struct's functions and variables, whereas it does in the downloaded version of the project. After some investigation I noticed that a key difference between my project and the teacher's is that my project has a Deployment Target of 8.1, whereas the teacher's has 8.0. I changed mine to 8.0 and immediately the syntax highlighting was restored and I could access the struct instance's functions and variables.
I'm guessing this may be a bug in Xcode, but perhaps I have something misconfigured in Xcode? I'd be grateful if anyone could explain how/why this bug occurred and what is best practice when choosing the Deployment Target.
The setting is located at Project > General > Deployment Info
I hope the above info may help others who encounter this issue.
Deployment Target is the iOS version that your app is intended for. This does not mean it is incompatible with other versions, simply that it is designed to work best on that version. Generally, using the app on a device with a newer version of the OS is much safer and less likely than using the app on a device with an older version of the OS. There's actually a lot of restrictions around installing an app with a deployment target higher than the OS version on the phone.
The most common deployment target right now is going to be 7.x, as most apps were updated when iOS 7 first came out (there was a pretty big change in UI standards and SDK functionality from 6 to 7), and iOS 8 isn't too terribly different from 7, so there's no need to restrict it and/or write new versions of the app for the new SDK. By having a deployment target of 7.x, you should ensure that the app works well on 7.x and all higher versions, including 8.x. You should also have the lowest deployment target you can that's reasonable - so, a purely iOS 8 app should ideally be targeting iOS 8.0. You'll save yourself a lot of PR and invalid bug reports from users who don't understand versioning.
In your scenario, it sounds like there may be a bug in Xcode when using the iOS 8.1 deployment target. You might want to check and see if your docs are downloaded. Go to Xcode -> Preferences -> Downloads and ensure everything is downloaded. I'm not sure if these are actually used in syntax highlighting and completion code, but it's possible. I would also do clean the build folder (Product -> Hold Alt -> Clean Build Folder). Again, I'm not sure, but I think there's just some small thing that's not clicking here. I'm assuming you cleared Derived Data based on your first paragraph - if not, do that (Window -> Organizer -> Select Project -> Delete).

Project is buggy after upgrading Xcode

I have an old app I maintaining. The app was first compiled on XCode 4.2. If I take the exact same project that works find and compile it on XCode 4.6 I'll get weird bugs such as ViewControllers not refreshing, Back doesn't work as it should etc'. If I'll take the same project and recompile it on xcode 4.2 on my other machine everything will work fine. Before I'm digging into the code, can someone give me an idea why something like this may happen? My main suspect is the Base SDK of each Xcode. Does that make sense?
I couldn't tell you if there will be a difference between 4.2 and 4.6, but historically the iOS frameworks on the device (and, to a lesser degree, the simulator) do adapt slightly depending on what version of the SDK an application was compiled against. You can't rule it out.
A classic (though now ancient) example is backgrounding. Apps built against older SDKs were quit when the Home button was pushed, rather than getting the newer behaviour. More recent (but subtle) examples have included several changes to table views and changes to device rotation.
You should not attempt to build with an older SDK using a newer compiler. Apple doesn't support that kind of configuration. You should always use the latest SDK. And you wouldn't want to pretend these problems don't exist, anyway: The bugs are real, they were just hidden before.
It's unlikely that you won't be able to fix those bugs in such a way that the older versions of iOS continue to function (though you may discover it opens a can of worms that you decide isn't worth fixing for older OSes).

finding unsupported apis with os version

I've developed and application for iPhone. It works fine on os4 but it does not work on os3.1. In fact works but there are some problems; after splash screen a what screen appears. while I leaving the application I can see the application is opened successfully but just see while exiting.
So I wonder if there is a tool which says which apis have problems with os3.1? So I have a chance to replace them.
If you want to check a specific API, just run this in your code somewhere with an appropriate response. For example, to see if print is supported, run this...
if (NSClassFromString(#"UIPrintInfo")) {
}
Set your project's Base SDK to iphone-os-3-1, then build. All the error messages about classes, methods, and functions that don't exist must designate things added since iphone-os-3-1, since your project built and linked fine against the iphone-os-4-0 SDK.
If you don't have the iphone-os-3-1 SDK, try this instead:
Open your project's Build Settings.
Find the "Preprocessor Macros" setting.
Edit it and add __IPHONE_OS_VERSION_MAX_ALLOWED=30100
Now, try building. This should cause everything introduced after iOS 3.1 to be labeled unavailable, producing the same errors as if you had switched to the iphone-os-3-1 SDK.
It's a good idea to get a second installation of Xcode for this situation, in this case you need 3.2.1 with SDK 3.1.3 - I wish I could help you with a download link since it is no longer shown on Apple's page, but I have googled in the past and found direct, official download links which will work as long as you are signed in with your developer account, so good luck.
The annoying bit is that you need to go through your project files and set "Base SDK" to 3.1.3 and then back once you have completed the exercise. But it is the easiest way to flag what you can't do in 3.1.3. "sudo rm -rf" (I feel nervous even typing that) has an excellent method there but you need to have an inkling of what might be safe and what might not before you implement it or else you end up with code 10x the size it needs to be.
Apple really needs to sort out this issue - hopefully by flagging methods that are prior to your specified "Deployment Target", in the same way that deprecated methods are flagged.

Resources