Xcode 6.1 doesn't recognize Foundation Classes - objective-c

I'm newbie in Apple developing, but im trying to develop an osx applications. I have yosemite as OS and Xcode 6.1 as IDE. Everything was ok 3 days, but at some random moment, my Xcode showed me this:
Everything covers with an errors.
What i did trying to resolve the problem:
Clean
Clean build folder
Delete derived data (in Organizer menu)
Reinstall Xcode
I even install Xcode 5 (but it don't support swift)
That erros follow me even in NEW project (with just one class AppDelegate.swift) and in any new class with any object like NS*.
What's happen with my Xcode and how i can fix it?
I forget to say, my project building and compiling without any error or warning. All errors disappears when i press button "Build".
UPDATE #1: i made: import Foundation - open it, and i did not find errors classes there. There are a lot of classes, such as NSCache and etc, but there are no NSTextField and etc.. Where are they?
UPDATE #2:
I've found that Xcode see classes which directly contains in Foundation moduel.
Also i got this window:

Related

XCode autocomplete not working for a particular project in Objective C

I am currently on XCode Beta Version 9.3 beta 2 (9Q107o. I am facing some issues with a particular project. Autocomplete seems to have broken for the project. Its working fine for other projects.
Can anyone please help. Can't seem to figure out.
Thanks
Autocomplete working in Xcode is by no means guaranteed and definitely not for a beta. Try quitting everything, deleting your derived data, restarting your computer and if that doesn't work, go back to a supported version.
You can do as #Alper say, If it doesn't work. try restore Xcode to the default Settings ,than restarting your Xcode
This is the officially recommended way to delta Xcode preferences, type in Terminal.app:
defaults delete com.apple.dt.Xcode
That should restore Xcode to the state of its first launch.
(for older versions of Xcode the command was defaults delete com.apple.Xcode, i.e. without the dt in the middle).

Invalid Binary Or Invalid Swift Support

After I send my app for approval to the app store I get the message 'Invalid Binary' in the iTunes Connect. Then I get the following message in an email from Apple:
Invalid Swift Support - The bundle contains an invalid implementation of Swift. The app may have been built or signed with non-compliant or pre-release tools. Visit developer.apple.com for more information.
My app is just a simple game application. No external programs are called. I have researched this message and went through and checked the following:
xcode is up to date - checked in app store
EMBEDDED_CONTENT_CONTAINS_SWIFT to YES or NO
send with the xcode app, not the application loader
did NOT build with the command line
(Xcode menu -> Preferences -> Locations tab - verified that the Command Line Tools matches Xcode version.
"Clean"ed the app, rebuilt and rearchived and then resent, same message
The app validates through the organizer fine
viewing the contents of the archive shows a SwiftSupport folder
I am only using one developer account and have never logged into any other developer account
I cannot find anything online that would help solve this problem.
I am running OS X Yosemite 10.10.1.
xcode version is 6.1.1 version 6A2008a - built, cleaned and sent with this version
I have also pressed the Option key and "Cleaned Build Folder" and resent, same message
I cannot find any other reason for this online or in any forums. Any help is greatly appreciated. Thank you for your time.
SOLUTION I FIND
Edit:
(1)
One you contact Apple and you wait long time … for reset iTunes connect because this problem coming in Apple . (Apple ask to send log of this problem)
(2)
An other solution, your create an other project application on iTunes connect and upload your work, this solution work fine, is the solution for me .
(3)
An other solution, you create a new project on Xcode, copy and paste your project in this other project.... (create new provisioning profile etc..) And upload your work in the same project application on Itunes Connect.
(4)
Step (2) + step (3), create a new project in Xcode and Itunes Connect.
(5)
Create a new project with the same name bundle identifier, it works perfectly !
See: Technical Q&A QA1881 Embedding Content with Swift in Objective-C.
It seems that you only need to set EMBEDDED_CONTENT_CONTAINS_SWIFT to YES "If you are building an app that does not use Swift but embeds content such as a framework that does".
What language is your app written in? If Swift yo do not need EMBEDDED_CONTENT_CONTAINS_SWIFT.
I ran into this problem the other day. Took some doing, but I finally figured out the problem ( for me at least). Everything I read online said the problem had to do with this setting:
EMBEDDED_CONTENT_CONTAINS_SWIFT
When this started failing, I had this set to NO. So I tried setting it to YES, and it still failed for the same reason. The GUI wouldn't let me remove this setting, I could only change it between YES and NO.
For what it's worth, my code has no EMBEDDED code, it's all just straight up SWIFT.
Anyway, so I decided to uninstall XCode and redownload it, hoping that would help.
While XCode was downloading, I fired up Beyond Compare, and compared my current project, with a backup from last week, to see what could have changed.
Beyond Compare found that a file deep inside the Projectname.xcodeproj file, changed ... a file called project.pbxproj file.
Inside this, was that line:
EMBEDDED_CONTENT_CONTAINS_SWIFT = NO;
This appeared in the current version of my project (that was failing). Interestingly enough, this line didn't exist at ALL in the old backup version from a week ago. I know that I didn't set this flag. There must have been something in Xcode that did it under the covers.
Anyway with that knowledge, Xcode finished downloading, and I reinstalled. Started it up, opened my project, and magically, Xcode REMOVED that line from the .pbxproj file, and now my project uploaded to itunesConnect sucessfully.
BottomLine: There's a bug in xcode that it may decide to add this line to your project for no reason, making your project invalid.
Solution: Editing the pbxproj file yourself and removing that line might work ... but reinstalling XCode seemed to clear up any confusion it had, and it removed it for me.
If you are submitting an app that has an AppleWatch extension, you can get this error if you try and submit the app using the Application Loader utility and a zip file. I got the error:
The bundle contains an invalid implementation of Swift. and
The bundle contains an invalid implementation of WatchKit.
I went through pretty much every solution for the first of the errors - but it was submitting via Xcode that fixed it.
well xcode 6.1 is a bit old and contains old swift. xcode 6.4 is the newest public one IIRC
"Check your code signing. I had this error when in automatic signing. I Put my dev profile for dev and production profile for release version and error is gone."
Link for the Quote
Sometimes this happens inadvertently.
To be safe, all components of your app should be built with the same version of Xcode and the Swift compiler to ensure that they work together.
I think you need to do a pod clean and install. I reckon one of your swift pods was created on a old version of Xcode, you updated Xcode and then tried to do a submission to the app store.
Read the apple swift blog about binary compatibility and frameworks
You will also want to specify that your embedded content contains swift in the build settings:
EMBEDDED_CONTENT_CONTAINS_SWIFT
Enable this setting to indicate that content embedded in a target's product contains Swift code, so that the standard Swift libraries can be included in the product.

why CPU is utilizing this much when I run xcode

Below is the screenshot of CPU utilization.
Just curious what are those Interface Builder Cocoa Touch Tool & ibtoold process.
Because of this, to run app, it takes me around 1 min least.
Note: I am using xcode 5
I see that this happens when there are more view controllers. I have around 25 view controllers.
Yes, I had created project in Xcode 4.6 and after updating, opened in Xcode 5.
Attached is the screenshot for the file inspector.
There is a stack overflow question along similar lines but the question involved only a single nib. The project in that case was created for iOS2 and used a new version of Xcode. This led me to examine the latest Interface Builder Release Notes (3.2) which states:
"Interface Builder documents can no longer be saved in the NIB 2.x
file format. NIB 2.x files will automatically be upgraded to NIB 3.x
files upon opening."
So, I would suggest you check the file inspector of your nib files and verify their current version. I suspect that Interface Builder is simply attempting to update 25 nib files to version 3.x. If you have an older Carbon nib files then please see the Xcode Release Notes (v.4.0 - current) as they require using version 3.2 in Xcode 4 and higher.
Xcode 4.6.3 displays versioning of nibs on the file inspector using these menu items:
While Xcode 5.0.1 displays versioning somewhat differently.
The project document should also be in the latest format:
.
The basic premise is that Xcode is converting the project file/nibs on load. If this recurs on every load I would report that as a bug to Apple at http://bugreport.apple.com. I think the information found is pointing to the correct issue. Checking that the files are using the latest version should fix the issue unless there is a bug.
Other things to try:
Load the project on a separate machine/directory (There might be some
corruption on your current one)
Run Console and capture logs as the problem is occurring (you will
need to also capture system logs for Apple anyhow but the Console
might show a useful error message)
References
What is Interface Builder Cocoa Touch Tool, link.
Xcode Release Notes (v. 4.0 - current), link.

Compiling/Running Cocoa Project implementing NSSharingServicePicker in 10.7.x

I am learning about Objective-C/Cocoa and have downloaded the source code to a popular TeX typesetter and loaded up the project in XCode to play around with it. Compiling fails, and all of the error messages I have seen (so far) have to do with something called NSSharingServicePicker not being recognized. I gather (from this SO question and this Apple documentation page) that this is a class not available in 10.7.x. It therefore makes sense why the code won't compile on my Lion machine.
My question is, I guess, why I am able to run the downloaded package of TeXShop on 10.7 at all? (According to the website, this version is for OSX 10.7 and up.) I am interested in making a few minor changes to this project; am I not able to check my changes/compile unless I'm using a Mountain Lion machine? Is there some kind of update I can download for coding/compiling purposes?
Assuming you are using Xcode 4.6.*, you should be able to set your project to use the 10.8 SDK and get past the compile errors. (That's the "Base SDK" build setting.)

Refactoring Problem XCode 4.0.1

So i was trying to refactor the name of a class in XCode following the steps in my text book. I'm sure I'm doing everything right and I downloaded XCode off the App Store. Basically, whenever I right-click -> refactor -> name -> preview, xcode crashes. Here's the error:
ASSERTION FAILURE in /SourceCache/DVTFoundation/DVTFoundation-227/Framework/Classes/Utilities/DVTTask.m:208
Details: The launch path must be set before launching.
Object:
Method: -launchRunningTerminationHandlerOnQueue:error:terminationHandler:
Thread: {name = (null), num = 15}
Hints: None
Any Ideas?
Thanks
P.S., sorry, i dont know how to using the quotes
EDIT: Fixed. I reinstalled with the package in side resources under "Show Package Contents" -> Resources -> XCODE and IOS SDK
If Xcode itself crashes, that's a bug in Xcode and you should report it. Using the Refactor command to rename a class definitely works at least some of the time -- I just tried it twice with Xcode 4.0.1 and the preview comes up with no problem.
I'd suggest creating a new project and trying the Refactor command there. If it works and doesn't crash, then your existing project may have something to do with the problem. If it doesn't work, that might suggest that the problem is related to your Xcode installation or machine configuration. This is just an attempt to help you find a way to work around the issue, though... Again, if Xcode is crashing, then there's a problem in Xcode.
Workaround:
Quit and restart Xcode before every attempt to use 'Refactor'.
For me on Lion running Xcode 4.4.1, a Refactor causes a crash every time if I've been doing any work. Even the simplest 'Rename' operation results in a crash.
If I restart Xcode, and make my first operation a 'Refactor', it works every time.
Further tip: It's a good time to make a backup, while quit before running a Refactor.