Xcode stops autocompleting, UIKit classes not available - ios

The topic has raised several times within the last weeks. Till now I haven't found a proper solution. Is it just a momentary Xcode bug or is there more behind it?
Scenario:
In one of my projects autocompletion has stopped working when I last opened it. Other projects are not affected. It looks kind of reasonable that once this problem is around, I also can't cmd+click the different classes imported by UIKit anymore like UIViewController or protocols like UITableViewDataSource within this particular project. An error pops up "Symbol Not Found". So in a way, even though it is working fine when running the app, it is just not available from inside the files.
Restarting Xcode, deleting derived data etc. hasn't brought me any further so far.
Any ideas? Or - like mentioned - really nothing else than just a bug?

I don't know which part exactly was the key issue but
Installing Xcode 6.1
Downloading iOS 8 libraries & Xcode 6 libraries within Preferences
solved the problem.

Setting active scheme works for me.
You have to select proper device corresponding to your installed components.
XCode 6.1 has iOS8 primary, so you have to select iPhone6 or Resizable iPhone, if you select iPhone5 it couldn't find it.
(project name>device) on the right of the 'Stop running' button

Related

After migrating to xcode 7 cocoa pods libraries stopped working

Recently new ios and xcode appeared so I decided to update to have a latest version. First of all migration manager popped out and left many syntax errors. But after one hour I fixed them all. App compiled and it was a disaster. I use several external libraries (written in objc) using cocoa pods. They mostly don't work now.
I'm using facebook image picker to get images from facebook - doesn't work, same for instagram image picker. As of my code also now ALAssets aren't working - well partially they are - I'm just not getting posterImages of groups and thumbnails of all photos. I can see correct amount of photos just thumbnails are all nils now.
There are more problems. Sometimes back button in navigation controller is not appearing. Anyone maybe I'd be able to fix that errors of 'my' code, but there's no way I'd fix all issues in these external libraries (especially in such a short time). I thought only swift will be impacted, but objc libraries are also under attack.
So is there an issue with some cocoa pods settings or just libraries will no longer work? I heard there's no way to use swift 1.2 in xcode 7. So I decided to downgrade back to 6.4. App compiled without any problem (after cleaning up derivedData). In simulator (ios 8.4) works like a charm. But on device with ios9 all the same issues are present. No photos thumbnails from gallery etc :)
Anyway there's one more thing. My app has to offer similar functionality to the one client has sent me few weeks ago. I may be unexperienced in ios programming, but this app isn't working as well! No photos from gallery :) And it's from appstore. It looked very professional. I smell serious changes under the ios 9 hood.
So I don't think it's something wrong with swift 2.0 - it's an ios itself.
I fixed all the problems! I just want to say they were not related to migration from swift 1.2 to swift 2.0. Going one by one:
nil thumbnails from ALAssetsLibrary - not sure why this was happening, but I restarted device and problem never came back. So good advice is to check if they're not nil (as I did).
Not working instagram and facebook libraries. Well first of all there's nothing wrong with cocoa pods. Reason of all this mess is App Transport Security. I had to add this to Info.plist file (last one not related to facebook/instagram):
http://pastebin.com/rWgyiKXH
You simple have to add all servers that app connects.
Not working back button - well that was a problem with my storyboard. I had many push segues, but every viewController was embeedded in navigationController. That worked on ios8, but not on ios9. I had to get rid of them and left first one and ones that were appearing by replace segue.
No need to downgrade :)

Very weird issues with xcode 7 and cloudkit

I have an app using CloudKit. After upgrading to iOS 9 it continued to work as it did previously with no issues. However, a couple days ago, I upgraded from Xcode 6 to 7. Xcode 7 broke some things visually...alignments, collectionview cell edge insets were changed, etc...definitely annoying, but it's probably some autolayout issues I needed to fix anyway. The real issue is beyond anything I've ever seen before. All of the sudden, my CK data will not get returned unless I'm connected to wifi AND a power source. At first I thought it had to be connected to the laptop and running from Xcode to the device. I tested it by disconnecting from the laptop and plugging into the wall and CK data was returned and CV cells got rendered. And whether or not it's connected to a power source, if I'm on cellular connection I just get the spinner (data loading) and it just sits there. And if it's running from Xcode, I don't see any logging happening either. But if i switch to wifi even while the app is running, then I see the logging of the CK results returned followed by the custom cell views being trigged and finally the cells get rendered on the device.
Just to be clear, I didn't make any coding changes around this happening...just upgraded to Xcode 7 (not the GM version). I did notice the below difference in info.plist when comparing in source control.
xcode 7:
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
xcode 6:
CFBundleIdentifier
com.drivethruu.${PRODUCT_NAME:xxxxxxxxx}
I replaced the actual product name with the "xxxx..." just for this post in case it's something I shouldn't be showing publicly. I did use the xcode 6 value just to see if that was the issue and got the exact same behavior. Didn't make it worse, but didn't make it any better. Also, I've changed the deployment target to everything between iOS 7.1 - 9.0 and no differences.
Anyone experiencing anything like this? Any idea on how to solve this?
UPDATE: Downloaded Xcode 6.4, discarded changes in the storyboard and info.plist files and recompiled and all issues resolved, so it's definitely some issue with Xcode 7. Still running iOS 9...will need to find out why the issue is happening on with Xcode 7 since I'll need to have the app iOS 9 certified before submitting. May need to open a ticket with Apple.
Thank you!
Apple has changed the behavior of the qualityOfService setting and the way data is fetched. In my opinion this is a CloudKit bug. For more information see:
iOS 9 CloudKit: query does not return anything while connected to cellular network
Please also make a bug report of this at http://bugreport.apple.com

Xcode 6.1 if/else/for/switch statements not autocompleting (Swift only)

I am not experiencing the autocomplete problem described in every other post. Normal function autocomplete works just fine. My issue is the version of Xcode I am running (6.1, Swift) will not autocomplete / auto-suggest any basic program statement (if, for, switch, do, etc.). If I type "if" for example, after a few seconds the suggestion menu pops up; however, there is no documentation in the window which would normally describe a statement's function (while at the same time presenting an auto laid-out example to fill in).
If I try a project in the same version of Xcode in Objective-C, these basic program statements complete just fine.
I have already:
1) Make sure my Settings are set to auto-suggest completions
2) Make sure I have cleared DerivedData and everything else suggested in previous posts
3) Reinstalled Xcode & restarted Mac countless times
4) Downloaded all latest "iOS 8.1, Xcode 6.1" documentation from "Xcode -> Preferences -> Documentation"
This used to work!! Arrgh. Any suggestions? Thank you.
Upgrade to Xcode 6.2 and clear your derived data. It should fix the problem.

Swift: Thread 1 signal SIGABRT

After upgrading Xcode from 5 to 6 beta, almost every project gives me an unexpected error after running the application. There are some other posts with this title but the error is different.
In AppDelegate.swift, sometimes the simulator goes completely black, without the error, sometimes it gives me the error on this line:
class AppDelegate: UIResponder, UIApplicationDelegate {
In Xcode 5 I didn't had this error before, with Deployment Target set to 7.0 or 7.1.
Thanks in advance.
This error is caused when you have 2 or more of the same IBOutlets or IBActions in your main.storyboard inspector (right arrow key at the very end of your options). Find out where there is double, and delete the one you don't need! It should work perfectly fine after that.
Seems like there was a bug with iOS 7.1 as target.
Running tests on devices with iOS 7.1 installed now works. (17028705)
Try it again with the beta 2 update
I found this issue happened when I linked #IBOutlet/#IBAction and the linkage broke (renaming for instance). In the main.storyboard inspector, right click (control click) on the elements and delete any bad linkages. Should fix the error if that's the issue.
(Xcode 7)
fix my problem:
Go to deployment info and in "Main interface" select your correct storyboard...
Rerun app.
My issues with this started after I installed the legacy simulators (iOS7.1) under 'More Simulators' under the simulator build target. Xcode 6 and its native simulator had been running fine until then. What fixed it for me was to close Xcode, delete Derived Data, and under iOS Simulator in the simulator application choose "Reset Content and Settings" then restart the system.
I'm new to the coding world but resolved the painstacking problem. I was getting the same error by doing something and even though i deleted everything around that i couldn't resolve it. It was still giving me the same error, which meant that it is not deleting in some file it stores. Took me a while to figure out which file, finally when i opened the Mainstoryboard as source file, and did search on the error key word which i knew i changed, it gave me the lines it was sitting in. After deleting those lines error got fixed. I know basic HTML so i knew which lines to delete.
I cannot start my project all over again everytime i have this error so i had to find the solution and there was no solution i could find. So i had to do it myself with common sense, as i said i have no knowledge of coding.
Hope it helps.
I know there's already plenty of answers but just to note what happened in my case:
I created the ViewController on the storyboard first and then I created the class, I don't know why this was an error because both class names where identical, but by rewriting the class name on the storyboard helped to "link" correctly the view controller and its file. First create file then ViewController on storyboard to prevent this error.

Building with iOS7 produces iOS6 looking widgets

After moving to XCode 5 and the iOS7 base SDK, some of the UI widgets in my app still look like iOS6-style (gradients, frames) on iOS7 devices. This doesn't happen on the equivalent emulator for iOS7. This also doesn't happen for all widgets, UIDocumentInteractionController's popup looks like iOS7 on device, but UIPopoverController doesn't. The keyboard for renaming a file also shows this discrepancy between emulator and device.
How does iOS determine the visual style of UI elements? Is it based on a statically linked library or something determined at runtime? I've tried purging the app from the device completely, but no change.
Emulator for retina iPad: UIPopoverController
iPad 3rd gen with iOS 7: UIPopoverController
The code in this case is fairly straightforward, no customization of the rendering or layout.
self.poController = [[UIPopoverController alloc] initWithContentViewController:audioCopyController];
[audioCopyController showDoneButton:NO];
audioCopyController.view.frame = CGRectMake(0,0,350,250);
_poController.popoverContentSize = audioCopyController.view.bounds.size;
_poController.delegate = self;
[_poController presentPopoverFromRect:view.audiocopyButton.frame
inView:view
permittedArrowDirections:UIPopoverArrowDirectionDown
animated:YES];
Thanks for the help in advance.
Check you Project config file and Target config file.
It is probably set with an iOS 6.X base SDK.
For this:
Go to your project config file in Xcode 5
Click the Build Settings tab
Edit the base SDK field to switch it to iOS 7.
Sometimes, we've experienced issues with Xcode not taking the current setting into account.
Changing it and compiling helps it understand that it needs to be changed.
Make sure you configure this correctly for your Project config and each and every target config file you run this from.
You might well have 2 different targets for simulator and for your devices.
Hope this helps
Regards
David
Ok, I found out what the problem was. David's suggestion got me thinking.
I am maintaining multiple apps at the same time, and one of them is quite old. The new Interface Builder in XCode5 breaks the transparency for a lot of the fields in the old app so I was keeping XCode4 in a separate installation folder alongside of XCode5. It seems that somehow my XCode5 project was still pointing at the SDK folders of XCode4 (not sure how this was possible, looking at the actual linker command line would probably shed some light), so after deleting XCode4's 6.1 SDK folder from my machine, a clean build with XCode 5 produced the correct iOS 7-looking widgets in my iOS-supported app.
The moral of the story is, be very careful with multiple XCode/SDK installations on the same machine. Hopefully this can help other folks who may be trying something similar to provide support for legacy apps.

Resources