Best way to rename an app in Xcode 6.3? - ios

Every time I select the Target(the app), then change the app's name in Identity and Type, Xcode crashes. Is there a good way to change the name of an existing app? Thanks

I was looking into a solution for this a few days ago, and unfortunately I think there's no straightforward way to rename a project. What I ended up doing, because I hadn't done much in the project, was to create a new project with the correct name and then copy the files I needed, such as the storyboards, class files, etc.

Related

How to persist data between xcode builds?

I'm actually developping an iOS Application and I'm facing a problem. In my application I have to store two kind of data : a product catalog, and a user preferences list on these products.
The catalog is a sqlite database and I need to update my catalog product at every build on xcode. No problem for this one I've added the file in the "Copy Bundle Resources" of the "Build Phases" of my project. So every time I build my application on xcode, the iPhone gets an updated database.
My problem is : I'd also like to store user preferences on these products that have to persist between xcode builds.
Question :
Is it possible to do something like this?
If yes : How? Is it possible to store this data in a sqlite database? What kind of file architecture am I supposed to implement to do something like this?
I've actually made a lot of research on this subject, but I can't find a solution...
Correct me if I'm doing it wrong, but I think this is possible.
Thank you :)
I've found a solution. The thing is, I think it is possible to realize something like I described before but I don't know how to do it. I'm still interested in the solution if someone have it.
The solution is to decentralize databases by using Firebase. By using Firebase database solution I can persist data through xcode builds.

How to reuse an Xcode project into a new project? Static library, Framework, Targets?

I built an iOS project (actually workspace because of Pods) that is 100% functional, with its logic and UI (Storyboard and xibs). Now I would like to reuse this app/project as a "core" for future apps.
I've been searching about it and there are several solutions like Static libraries, Frameworks and Targets. But I am not sure which one would be the best in my case. I would like to reuse all the UI part as well.
I saw that most of the people agree that the best approach for reusing code is static libraries, even thought it looks not so straight forward. But I think for reusing UI probably Targets is the best solution. The problem I see is that if a build 10 apps based on my core project, the new project will be huge, so probably it is not the best option.
I don't know if you guys have any better idea or opinion.
Thanks in advance!!
There are several things you can do, and I will try to go through them.
If you have minor changes on your "base" app, then the best thing would be using targets(build schemes). This way you can add things to build phases and therefore, add files that you need. This might be the quickest possible way to do what you want but here are some drawbacks: What if you have 5 apps, and for each one you have QA and prod. That 10 build phases. If you keep using your app in no time you will find hard to manage it.
Another thing could be to create different project, and include all the files you have (and you need), inherit from there and have extended functionality/UI/UX. This is slower approach then number 1, but you will have dependency on the files that you might change in one app and don't want to propagate that change in other apps. So the drawback would be that you have to be extra careful, and plan a lot of things in advance.
Third thing could be to create base app group(or project) and then you are certain what to do, where and what that change could do to other apps(since you know that this file is actually being reused).
And finally, there is a framework, which is my favorite. I am working on one project that inherits base app and we found that is a huge problem. You start separated and then, one thing by one, you have entangled code for specific app and base app like headphones in pocket. And if you don't refactor it ASAP, it will became really hard to resolve these kind of issue. Not to mention merging and other stuff. Here is an excellent article about creating framework http://www.raywenderlich.com/65964/create-a-framework-for-ios . Off course, there is a price to pay and that's every change that you create you must update library and add it again to project. This thing can be easily forgotten and if you are working in team could produce build crash.
All after all, you predicate that you will have more then 5 apps, so I would say go with the framework. This way you will have much cleaner and separated app, and won't have to think about changing things and how these changes would affect your other apps.
I recommend you use a custom project template. I did it perfectly today. I had the same needs as your. Follow this link: https://github.com/reidmain/Xcode-6-Project-Templates/tree/master/iOS%20Application.xctemplate
Download it. You can add all the files from existing project into this template, storyboards too. If you have any doubts I will help you.

iOS 8 App Extension and Host App in separate project files. Is it possible in Xcode 6?

Currently we're using premake5 to generate our project files, as we develop multi-platform. Obviously we don't need premake to know anything about the extension (as it's iOS8 exclusive feature) but we're facing a problem: Every time we regenerate the main app project file (which happens sometimes) we're forced to manually add all the files and configure the extension, which is dull and error-prone.
Is there a way to add the app extension (a Today Widget) to a separate project? Pbxproj files aren't version control friendly as its contents seem to be shuffled every time you save. So, saving a patch file with all the changes needed doesn't seem like an alternative.
I know this is a broad question about a convenience issue, maybe seasoned Xcode devs know some trickery (or maybe it's just something obvious we're missing here).
Thanks all in advance.

What is the "Tests" target under xcode5

Please don't flame me here. I've searched and can't find this.
Why does Xcode 5 add a second target with "Tests" at the end? Example "myApp" and then "myAppTests".
Why do I want that?
I think I've deleted it in the past, but I'm annoyed that it adds it. Is there an easy way to create new templates that are more like the old ones without it?
It is for unit testing, I do not know if since Xcode 5 you are able to create a project without this target.
You might have a look over here : http://remotewhiteboard.com/blog/apps/how-to-delete-a-target-in-xcode-5/

Reuse Xcode project for new app

Similar questions have been asked before, but I can't find the specific details I'm looking for. I have an Xcode project which has been completed and submitted and is on the App Store. I want to make a similar app for release in a different country. To avoid complications, I want to use a fresh project in which to make the changes. I intend to make a copy of the original project, tweak it, and then release it (this is not about language so localization is not the answer).
Because Xcode is doing so much complicated stuff under the hood, and because I'm unsure of exactly which details are being validated when submitting to the App Store, I don't know which details I need to change to ensure two separate projects on my Mac and two separate apps in iTunes Connect.
Obviously I will need new provisioning profiles for the new project. What else do I need to change once I've duplicated my project? The bundle identifier maybe? Anything else? Any advice much appreciated.
The thing that must change between projects is the application ID (or bundle identifier, as you called it).
And yes, when you change the application ID, you do need to create new provisioning profiles to go with it.
If you're feeling really ambitious, you can use the exact same project as your original one and merely create a new target (and application). That way any code changes you make to one can be picked up by the other and the differences would be the ID and maybe the localizations/resources used in each app. Here is a related question that talks about that.

Resources