How to uninstall iOS QuickBlox SDK from OS X project? - ios

I was curious about whether the QuickBlox iOS SDK would work in a Mac OS X project. I followed these instructions:
http://quickblox.com/developers/IOS-how-to-connect-Quickblox-framework
More specifically, since my project is in Swift, I followed the ones at the bottom, the "Additional steps for Swift using Manual Installation", except that MobileCoreServices didn't exist for OS X.
When that didn't work, I messed around with the steps further up in "Manual installation" such as changing the linker flags.
It didn't work (at least not without warnings). So I undid everything I messed with (and I'm pretty sure I only messed with things that were in the instructions).
Now, when I hit run, the project says "Build Succeeded" and the bar at the top says "Finished running", but no application opens.
I checked each of the frameworks I added and they're all gone. I checked each of the "Build Settings" I changed and they're all back to how they were. In Source Control when I hit "Commit" I can see that there aren't any changes to commit. My project seems to be exactly how it used to be, and I'm left scratching my head about what could have changed. Any suggestions?

OK, I'm not sure what caused this, but here's how I got my app to run again:
First, I tried adding Quickblox to a new dummy project to try to recreate the error, but the dummy project wouldn't break in the same way that my good project did.
So then I tried to use Source Control to restore my last working version by clicking "Discard All Changes...". Source Control did not restore my last working version but instead reinstalled Quickblox, moved random files into the trash, and broke the links on all of the other files so that my list of files was mostly red.
So I decided to create a new Xcode project and move the files from my old project into this new project. While this new project was still blank, I could test "run" and see that the blank application would open onto my computer. So then I began the process of moving things over which took some time.
A couple of things to note when you're doing such a migration: entitlements and info.plist files, when dragged into a project, are added to "Copy Bundle Resources" and need to be deleted from that list. Moving an xcdatamodeld file from Finder into a project doesn't work very well, but moving it straight from another project into a project does. I had to reconfigure provisioning profiles. Then, Core Data entities can cause errors if their "Module" is still set to the old project's name (changing these modules to "Current Product Module" worked). After all of that, my project was up and running again!

Related

Xcode 12 how to add an existing project to a workspace

I cannot believe how hard this is. Perhaps because the word 'workspace' is overloaded by Apple and perhaps because the UI keeps changing every version. For a newbie to iOS, Xcode and Apple it's a nightmare.
I have Xcode 12
I have created a project.
I used File/save as
workspace to create a workspace to (eventually) hold multiple
projects.
Gave it a name.
I have another already created project (a
static library) that I would like to add to this workspace.
I cannot for the life of me figure out how to do it. I see things for
previous Xcode versions but those UI options are not present in 12.
In the end I want to have a workspace where I have a demo project that uses the static library project for Bluetooth LE communications. I will be spending 90% of my time developing the BT library so I want to be able to access the source of both projects.
By the way, I am not using Storyboards. Not sure if that makes a difference, but just in case!
Thanks for any help
You can do this by
Close the project to add in Xcode
Drag the existing.xcodeproj file (one you closed) from Finder to Xcode and drop it next to existing sources/projects in the workspace
Xcode settings are often painful for even seasoned developers. And every update seems to break something.
As far as I can tell it just doesn't seem possible.
The only option seems to be to create the workspace in XCode 11 add the projects there then open in XCode 12
If you already have a Workspace (i.e. a .xcworkspace file) ready to go, all you need to do is:
Close your project
Open your Workspace
Go to File > Add Files to "<your_workspace_name>"...
Select your existing project
Xcode will duplicate the references to your files, so you manually have to go to the Project navigator (shortcut: ⌘ + 1), select the duplicated references (they'll be at your Workspace's root) and delete them (select Remove Reference, not Move to Trash)
Enjoy your Workspace!
For good measure, select your scheme (most times it'll become available immediately, but sometimes you'll need to restart Xcode), build, and run your project to verify that everything went well.
Verified in Xcode 13.

After changing file locations, project can't recognize some of my classes

First off, I know this is a config issue because my code was building and running just fine before I synced my project to GitHub. Xcode's internal source control seems to be having trouble recognizing some of my files and I'm getting Use of unresolved identifier... errors where these files' initializers are in use, and were working before. I'm running the latest versions of Xcode and OS X, and these are the steps I was taking before and after the issue started...
BEFORE:
After several rounds of implementation and committing with the default local repository, I built and ran the app multiple times with no issues.
I created a new repository on GitHub, committed (w/push to remotes) and everything made it to GitHub just fine and was building and running in the simulator.
In order to organize the repository (to match the 'groups' I had created in Xcode) I did some brief research and then added nested directories to my project folder. I re-opened Xcode and repaired the file paths. Some took, but several kept showing ? (although I could still access the code just fine) and I got the corresponding Missing Files... warnings.
Because I couldn't get the new hierarchy to work (the files w/?s, not being recognized, were not able to be committed to GitHub), I tried to move the files back. This worked for most, but for a few (which seem to be the effected files) I had to rename them, recreate a new file and then paste their contents over (this is where I think the problem lies). I was able to commit everything to GitHub (even the problem files went up) but all the warnings remained.
To clear out the warnings I attempted to run my tests, and that's when the Use of unresolved identifier... errors popped up, and of course the build failed.
AFTER:
I verified all the paths and target memberships were correct.
When that didn't work, I built an entirely new project (although I did add it to the same workspace; not sure if that matters) and copy/pasted all my code over to new files. I didn't drag / reference the files and I didn't link the new project to GitHub. When I went to build, same errors in the same places...
I exited the workspace and opened the new project separately. Still no joy.
Any help or points in the right direction would be much appreciated.
EDIT:
After some help, I tried deleting the reference and dragging the file in manually but that didn't resolve the issue.
I also checked Build Phases -> Compile Sources and everything was listed fine with no compiler flags. I removed and re-added from Compile Sources, issue persists.
You can try removing referencer for the missing class file in Xcode,then add same file to folder (right click add file ) from physical workspace location this might help.
After rebuilding an entirely new app a third time, with all new files, I copied the files over and this time everything seems to be working fine. Had to repair a bunch of provisioning issues to make sure it worked (maybe that was part of the problem, but I doubt it), but everything is back to normal with the app. The only thing I did differently this time was not adding the new project to the same workspace.

Get lost Xcode binary from archive in organizer?

Alright, so I had been having issues with this and never resolved them, finished my app and published it before this caused major problems -
I have pods installed for my Xcode project so I had been working off a workspace. I had always backed up in the past by copy pasting my project folder then renaming, however more recently something happened that cause every change to my workspace to affect all previous versions.
I tried everything - saving to external hard drive, github, etc but I just ended up going on working on the workspace and making sure I didn't screw anything up. Along with this issue whenever I clicked on the Xcode project that is in the project folder, none of my new code would be there.
That Xcode project version was from several months back and the only way to see my new code was to click on the workspace. I asked a question about this but no one had an answer.
A week ago I finished the app, archived and uploaded to App store. It is now published, however I want to update so today I went to my workspace and the project file above the pods file was RED meaning not there.
I have no idea why this would have happened. Dragging the Xcode project i the folder to the workspace again, just runs the very old version.
I need to get my binary back and solve this problem. Im desperate. I have this:
One of the export options is save for development and such.. Is there a way to get my binary back from this archive? How can I fix this problem?

Is there any better way to rename an XCode project than the given one?

The given version is described here: How do I rename a project in Xcode 5?
But, as you can see from the following screenshot^, not everything gets renamed, and if one opens package contents, directory names etc. to try to manually change all the references, the project is broken afterwards, so you have to keep the old project name for sub directories etc., which granted is not a massive problem, but is intensely irritating, and I'm not enjoying being intensely irritated at work.
^ apologies for a screenshot, but there's too much information in it to transcribe to written text. Top two-thirds of screenshot is XCode project, bottom third a Finder window.
Renaming projects in xcode in one of the most annoying things in iOS development. I assume you want to rename your app. I faced this problem once and figured out a simple, clean way to do it.
Go back to the point where everything worked.
Open project in xcode and click on the project icon in the project structure( first file)
Go to the info tab
Search for Bundle Name. Most probably it will automatically be set to $(PRODUCT_NAME) which is a shell variable that will set your app name the same as the project name.
Set it to whatever you want your app name to be
Done
Notes :
If you use custom URL Schemes this might produce an error when redirecting.
ALWAYS git or some other SVN in your projects. This will come in handy in this kind of situations

How does Xcode compile files when changes are made in a project?

I am new to iOS programming and Xcode. Please help me understand how does Xcode compile and run the code.
Ideally an IDE knows the changes made in the progranm and the next time when we compile or run it, it knows which files need to be compiled again. But while I was trying to add storyboards in a project which was working fine with a few ViewControllers and XIB files,
I moved the view from an existing xib file to a ViewController in the storyboard and changed the name of the class to its respective ViewController in the Identity Inspector and I deleted the XIB file. When I ran the program, I didn't see anything different happening. Out of curiosity I deleted all the XIB files and then again ran the program but the still the project ran perfectly.
Then finally I deleted all the files present in my project and when prompted to either "Send to Trash" or "Remove References" I chose remove references and again built and ran the application, but there was no problem and again it ran perfectly.
After that I closed the project and again opened the project from the 'Finder' and ran it this time finally I got more than 30 errors which were not resolved even after I added all the files back to the project in Xcode.
Please help me understand how Xcode compiles the projects and also that what I may be doing wrong to move the views in the XIB files to "Storyboard" in a project.
You are right in your understanding that XCode should detect changes and know when to rebuild things, however, XCode is not perfect, and is sometimes buggy. You can "Clean" the project under the Product menu to get it to rebuild.
You did not say if you were running on the simulator or not. I often have problems when adding or removing resources and running on a device. To fix these issues, you can delete the app on the device.
Restarting XCode also often fixes issues.
Also, ensure you have the latest version of XCode.
If you get to the point where you can recreate issues, consider submitting a bug report.

Resources