upgrading to iOS 7 and Xcode 5 - having issues with UIAccelerator, UIStringDrawing and NSObject - iphone

I updated my iPad to iOS 7, and discovered that the Enterprise app that I have been working on for over a year crashes. OK, no problem, I'll see where in Xcode it's crashing.
OK, Problem: I have to upgrade to Xcode 5 to debug iOS 7. OK, no problem, I'll upgrade to Xcode 5.
OK, Problem: The source code in Xcode 5 now shows 19 errors: One in NSObject.h, three in UIStringDrawing.h, and the rest in UIAccelerometer.h.
And, for a bonus, it adds one at the bottom, "Too many errors emitted, stopping now." Which is not all that comforting.
I've really scoured the internet for answers, but I must be using the wrong search terms because I am finding nothing that addresses this. Surely I am not the only one.
I have been developing iOS apps for almost two years now, I think, but I am still pretty stupid when it comes down to the nitty-gritty stuff. I usually just hit "Run" and hope it works. So far that has been a pretty effective strategy, but now I am stumped.
Can anyone tell me what I am doing wrong? Except the obvious, being that I should have left everything well enough alone.
I will also have to update my previous app, because it has iOS 7 issues too, but it scares me to even think of it.
I appreciate any help anyone can give.

I found the answer here: http://blog.spacemanlabs.com/2013/09/how-to-support-old-ios-sdks-in-xcode-5/#comment-1056917662
After figuring out how to do all this, the app showed a couple more errors unrelated to the original problem. Turns out I had a couple of XIBs set for Autolayout. Those being disabled, the app worked great on my iOS 6 phone with Xcode 5.

Glad you were able to switch back to the iOS 6 SDK. I had the same errors in UIAccelerometer.h and NSObject.h, but wanted to stick with the iOS 7 SDK.
For me, these errors were the result of stray copies of UIKit.framework, Foundation.framework (And a couple of other frameworks) inside my project folder. These were seen by the linker, hence the "duplicate symbol" error messages thrown. As soon as I got rid of the frameworks in the project folder and re-linked to the frameworks in "Build Phases" -> "Link Binary With Libraries," everything built.

Related

iPad version crashing

I am new to iOS development. I was opening the .xib file in the editor and tried to make an iPad version of the app. I went to File > Make iPad Version. An iPad UI appeared. I closed it and didn't save it.
The problem now is that the app is now crashing when viewed from an iPad.
Thanks!
Here's an official answer or, to be more precise, a couple of useful tips from someone who is also new to ios development (4 months):
First of all, update your xcode version. If you are new, there is absolutely no point in starting with an older version. True, it may have a bit more tutorials but it's not that hard to find stuff for xcode 4. Trust me, been there, done that ;)
Second, if you run your app on a device and it crashes, you will get a crash log. Connect the ipad to your pc and open the organizer window from xcode. There, go to Devices and select the logs for your device. The log will help you detect the cause of your problem.
Third, when you will encounter more problems like this in the future, be more detailed when asking for help on stackoverflaw. Post more info, error logs, print screens, etc. Basically, anything that could help others help you

I seem to be getting a huge amount of errors in XCode with ASI HTTP Request?

I am getting about thirty issues already with the files which I downloaded from http://allseeing-i.com/ASIHTTPRequest/.
See http://f.cl.ly/items/0J0l3w1t1n222N3E3v44/ASIErrors.tiff for a few errors highlighted in XCode.
Do I have to go through each one individually to fix or is there a simple fix?
EDIT: It seems to be something to do with "ARC"?
Thanks!
Guessing you're trying to compile with XCode 4.2 / iOS 5. You'll need to turn off ARC. Here's an article that shows how to do it for the whole project:
http://matthiaswessendorf.wordpress.com/2011/09/12/disabling-the-arc-in-xcode-4-2/

Newbie: Errors in an iPhone app

I'm really newbie in iOS and I have to handle a complicated situation. I was given an iPhone app developed by someone and I have to make it work. The guy who developed it has told me that it worked, but sometimes crashed in an iPhone. I've never developed using iOS and I don't really know how this app works.
Well, when I open the app with Xcode, the first problem that I detect is some errors with the references. The app uses the project CorePlot-CocoaTouch.xcodeproj. I've added again this project and solved the references (I've followed some other posts like this one: http://www.jaysonjc.com/programming/pie-chart-drawing-in-iphone-using-core-plot-library.html).
I want to test it with the simulator (I don't have an iPhone yet). I have a doubt here...should I use iOS Device, or iOS Simulator as Base SDK? Firstly I chose iOS Simulator, but it appeared a problem with Cocoa.framework (it turned into red).
Anyway, using iOS Device as Base SDK, I build the project and it says "Build failed (59 errors, 3 warnings)". I check out the errors, and most of them are "Expected specifier-qualifier-list before ..."
Can anyone help me? This is more or less the situation, but I can provide more specific details if they're needed.
I'm sorry if I'm talking about something really basic, but I've been trying to solve it for 2 weeks and I give up. I've tried to talk to the guy, but he's not really helpful..
Thanks for the replies!
By the way, I didn't say it and I don't know if it's relevant or what it means. The guy has a directory called "Libraries" where it's stored the CorePlot. The files there are the same than if you download the CorePlot project from other source. The only exception is a folder called "SDKBuild", which contains files like "build.sh", "iphoneos-SDKSettings.plist" or "iphonesimulator-SDKSettings.plist". I'm really newbie, so it's probably obvious, but I have no idea...
just try to add CocoaTouch framework to your project.
and for base SDK use "latest iOS".
Right click on the project name in 'group & files' set on the left of xcode. Choose add -> Existing Frameworks.
Find Cocoa.framwork and click add. Do this to all red colored framework.
Choose IOS Simulator as base SDK.
Try run it..
If you want to run the app on simulator, you have to build with iOS simulator. The base SDK basically sets the OS version (this will be the same regardless of whether you are running the app on simulator or device). You should be chaining the build settings to device only if the device is connected and if you have installed the appropriate provisioning profiles.

Unable to find a document class... com.apple.InterfaceBuilder3.CocoaTouch.XIB

I have two versions of Xcode installed: Xcode 4 in /Developer/ and Xcode 3 in /User/Xcode3/.
While working on an iPhone app in Xcode 4 I suddenly got this error:
I have no idea where or why this has started. I thought it might be related to this post, but the main solution which has received 32 up votes does not work for me. I did notice that my Xcode 4 folder was missing the InterfaceBuilder app for some reason which I then copied and pasted from my Xcode 3 folder. Not that it made any difference.
Any ideas?
EDIT 1
Also, I should note that even though when I 'get info' on the project and it states that it defaults open to Xcode 4 when I double click on the project it opens with Xcode 3. Therefore I choose to open with Xcode 4. Still doesn't help.
EDIT 2
Also, when I click on the .xib files, I just see string values, no GUI.
I completely reinstalled Xcode 4 and that seemed to do the trick. But I must say I am quite paranoid when I open up projects. I have the impression that if I use the wrong version of Xcode with the wrong project this problem will come back.
Any illumination on this bug would be greatly appreciated.

Why does Xcode keep changing its active executable?

Something really weird is going on with Xcode and an iPhone project I'm working on, when I'm building for the simulator, the project has 2 active executables (MyApp - iPhone Simulator (2.0) and MyApp - iPhone Simulator (2.1)) Almost all of the time, I want to use the the 2.1 active executable, but Xcode will occasionally silently change to the 2.0 one.
There doesn't seem to be any pattern to this or any trigger that I can notice. Googling has found a couple of people out there who are having the same problem, but no solutions.
Help me stackoverflow-kenobi! You're my only hope!
Ok, it was a bug. The good news: it's fixed in the fresh new 2.2 SDK.
That is weird -- I've been doing iPhone/XCode development for a while, now, and never seen anything like that.
Are you absolutely certain that you're not poking around some place that's causing the change?
Might you have a corrupt XCode or .xcodeproj? If it persists, I'd try re-creating my project and, if that didn't help, reinstalling XCode.
Very strange, indeed...!
I have the same problem. I need to set the active Executable to 2.1 for openAL to work. The pattern I observed is that it switches back everytime I switch to export to the device. Isn't that what happens with you?
I've seen the issue commented a couple of times on the official iphone dev forum, but no solutions. Looks like a bug.
So.. why are you actually doing that? It is probably better, given the nature of the iPhone (with multiple frameworks for multiple architectures), to set up different Targets for your various projects. The executable produced will be the result of the build phases for your targets.