I stupidly turned on OBJC Automatic Reference Counting (ARC). Now my code is messed up. Can I undo? - ios

I code in Javascript using the Appcelerator framework.
This AM I decided to open Xcode and turn on ARC based on some online advice.
Well it seems Xcode refactored all my original JS files into something I cannot understand or read.
This project has been something I've been working on for years. My last backup is from 6 months ago, so going back to that one is a very very painful option.
Is there any way to 'undo' the refactoring and bring back my original files. Either in Xcode, OS X or any kind of way. I'll do anything at this point, since I'm suicidal now and stepping outside to get some fresh air and relax :)
Thank you for any advice!!!!! I'll give away all my points to help fix this :)

Related

Transferring Xcode Project from one computer to another brings random errors?

I have a Xcode project I got from another developer. Initially when I opened it it has a bunch of errors (most of which were un-updated frameworks). I got it to work after a while and I fixed it. I want pass it back to the manager since I'm leaving uni in a few months. I copied it over to my friends Mac to see what would happen if I just took the project and all it's folders and made it a zipfile. It didn't work for some reason. It gave me an error:
error: using bridging headers with framework targets is unsupported
But why did that come up? I mean it's the same code on the slightly different versions of Xcode (13.1 versos 14.1) but I doubt there was a massive change between the two that would cause this. I want to be able to pass these app later in the future without having to care about this stuff. I made a GitHub (link below) would cloning that work? Also the laptop I chose was just a fresh reset. Would it be due to not having coco-pods installed?
I feel like I could go through and fix it all on that laptop and document that but then I'm afraid that every time I put it on a new one it would come up with random errors every single time making my documentation moot.
https://github.com/AbdullahMSaid/SonicExperiment-Works
With big help this was Fixed.
Things that fixed it.
Having the correct version of Xcode
Turning everything from absolute path to relative
Lots of other code fixes. But those are my project specific.
You don't need bridging headers in framework. Use should have something like "YourFramework.h" where you can import your .h files.

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

Add large database file to iOS App bundle at compile time to avoid indexing?

I'm having a severe problem using the new versions of Xcode (4.4 & 4.5) in that, my project has a very large .sql database file stored in the project. This file cannot change, for many reasons... but it is +270Mb in size. This causes Xcode to hang on 'Indexing File...' and becomes completely slow and unresponsive to the point that I have to force quit the app, and cannot actually get any coding done. I have raised a bug report with Apple several times, but it is seemingly being ignored!
I do not want to disable Xcode indexing entirely as i find the code completion features incredibly useful.
My question is: Can i remove the database from the Xcode bundle resources, and then add it automatically at compile time?
Would appreciate any and all advice on how I could get round this problem.
Regards,
Sam
Incase anyone comes across this problem of Xcode indexing a huge unwanted file... I fixed it by setting the file type in Xcode to an 'MP3 Audio file'...
Doesn't seem to have any effect on the function of the .sql file once it's in the App, but stops Xcode trying to index it.
If anyone has a better solution for this, i'd love to hear it!

using panoramaGL library in ios5 and running HelloPanorama

I've been search around how to setup panoramaGL for a whole day and none of these answers my questions. emm, maybe that's because I am new to ios developing and I start with ios5 with all ARC cool features. I did find a pretty comprehensive guide at http://www.codeproject.com/Articles/60635/Panorama-360-iPod-Touch-iPhone but it's a little bit out of date to me. I cannot follow this guide in xcode 4.3 with ios 5.0 sdk.
Emm, so here is the question, assuming panoramaGL and helloPanorama works perfectly fine in whatever xcode version and sdk version it is created in. Is there a way , without any code modification, I can import the library and using the api along with my app developed in ios5? Of course I don't mind some minor modification and I did dive into those code and comment all the retain or release stuff. but wired errors keep popping up. I really need help here.
If it finally turns out to be impossible to reuse it in ios5.0, I will probably need to write the whole thing line by line with my understand of the complicated panorama algorithm...
Thanks so much for the help!
It seems someone is working on another library based on panoramaGL. Works on IOS 5.
See http://code.google.com/p/tk-panorama/
The new version of PanoramaGL 0.1 r2 was released, please check http://code.google.com/p/panoramagl/. This version runs on iOS >= 4.x and supports Hotspots.
Please check HelloPanoramaGL example

XCode 4.2 on OSX 10.7.1 (Lion) Crashing/Locking Up all the time. Anyone Know how to fix?

This should not create any Issues with the NDA as I am not asking anyone to reveal any functionality of the application, I have asked on the Developer Forums, but They dont have the user base or the response speed of StackOverflow.
I have been working with XCode for a while now. And other then these issues, I REALLY LIKE the new xcode. I will (when these issues are resolved) recommend this application to all iOS/OSX developers.
Anyhow.
I am currently developing iOS applications. And am Running this setup on Mac OSX 10.7.1 (Lion)
Issue 1:
If I use the Interface builder it will first of all stay open even after I navigate away from it and it is no longer visible or to my knowledge "running". After a while it will consume more then 4 gigs of active memory. I will have the activity monitor open and Will eventually have less than 20megs left of free memory. I upgraded my MacMini to 8 Gigs of memory and at this point it will get down to about 200 Megs of memory left and will eventually release the memory that IB had held onto. If I do not open IB in XCode 4 it tends to use a lot less memory. (adding 8 gigs of memory makes this memory leak a lot less of a problem)
Issue 2: (MOST ANNOYING, HOPING FOR A FIX TO THIS ONE MOST)
This one only currently happens on one of the Three machines I code on. And what happens is while programming if I [Run] the app it will work for a while. Then at some point through the process it will begin to Lock Up when I press Run or Command-R. If I save the code file and run. It will not lock up. However if I forget to save, It will not only lock up. But will force me to terminate the XCode app, and Subsequently Recode everything that I had edited since the last save and the Application Run. This is by far the most annoying bug I have encountered this far.
Issue 3:
This bug happens more and more often the longer the application and operating system has been running. Running into the iPad will give me a number of Errors including "Unable to Connect to Debugger" or "Finished Successfully" among others. But the important part of this issue is that the application will never get sent to the iOS device. It will compile and say it finished. But there will be a error in the output pane.
I hope others have encountered these errors and Hopefully there is a quick fix with config files or something that will make development a lot more convenient. Thanks to anyone for resolution to any of these issues.....
EDIT
I finally received an email from apple support. I have emailed them off a Capture from XCode 4 and will hopefully hear something from them. Or maybe they will just release a new beta. Either way I hope to get this resolved asap.
For issue #2 you might want to try auto-saving your code before runs. See XCODE auto save code when build and run? instructions. Not sure if these instructions will work for 4.2 but you get the idea.
I had issues with my Xcode 4.2 install crashing initially. Re-running the installer over the already installed Xcode 4.2 fixed them. Obviously I don't know what the underlying issue with the install was, but although the first install reported installation was successful, obviously it wasn't. Perhaps worth trying.
When a newer version of Xcode 4.2 becomes available to you (cough), you might want to see whether installing that one fixes the problem. Perhaps given the issues, you should try uninstalling the previous version first rather than installing over the top?
Do you use multiple windows? They are anathema to Xcode 4. If you persist in your heresy, it may corrupt some files, and slow itself down. You will see a lot of beachballing, and it will be in some sort of GC.
You can work around this by deleting a workspace-specific file hidden inside your project. (I will have to look up which one, if this describes your case.)
With the new Beta GM Release they have seemingly fixed the issue with the Hanging.
Thanks for the Answers. Ill +1 anyone who helped but ultimately it was apple that fixed the issue.... For now

Resources