So I am new to Xcode and Macs and I seem to be getting a lot of errors after trying to add a new framework. I needed the NSMatrix class and it was not included in the default frameworks (Foundation, CoreGraphics, UIKit, XCTest were. So I added the AppKit framework using Project Navigator>General>Linked Frameworks and Libraries. After I added that and #imported Appkit/AppKit.h in the .h that needed the NSMatrix class the errors for NSMatrix went away and it turned blue. Indicating that it found it I assume.
After that I tried compiling the project and got these errors:
http://i1346.photobucket.com/albums/p694/parkertmorris/ScreenShot2014-04-07at42152PM_zps3a1fdfdd.png
I tried removing the AppKit framework and the reference to it and compiling but I still get these errors. I also tried cleaning the project and deleting the DerivedData folder but nothing is changing.
Any ideas how I can fix this? Tried to research this problem for at least an hour.
Thanks
You and I are both new users (although I am a long time reader) to SO, and as such I'll try my best to help :)
I noticed you tagged this under "iOS". AppKit and NSMatrix are OS X specific, not for iOS, and you may want to remove the iOS tag as such and tag the question appropriately.
When problems like this happen to me in XCode, which occur less frequently with experience but still at annoying intervals, I tend to step backwards using Git (or whatever SCM you like) to a point where things are the least messed up. Based on the fact that your compiler errors are still occurring without AppKit/NSMatrix references, your problem likely exists independent of the framework, or at least alongside the framework.
Try opening your project.pbxproj file inside your project package and looking for duplicate entries of .h files under the same groupings. These types of problems sometimes bite me when rebasing/merging in Git and 90% of the time I can fix them with a very simple change to my project.pbxproj file. Even better, try diffing your previously working .pbxproj with it's current state and see what's going on.
Related
Im running Xcode 9.2. My storyboards are completely useless now. Ive
experienced what this article shows and have tried everything the
article suggested.
My issue occurred when I tried to add a single swift file to an existing
objective C project with about 320 files in it already. I removed the
.swift file entirely from the project, then did everything in the article
link above and still nothing fixed it including removing/reloading XCode
several times trying different things.
I filed a bug with apple but haven't received any replies in a week (of course). Apple seems to be slammed with tons of bugs lately they keep
creating.
Now I cannot work on this project's storyboards at all and Im dead in the
water. Really not happy with Apple lately!
Is there anything more that anyone has had success in fixing this issue?
Im completely dead in the water on this application now.
Fixed this by setting the command line tools version to the correct one. Mine was blank in Preferences / Locations
For my case, whenever I open a storyboard from a workspace, this happens. So I got rid of cocoapods and workspace, then just use carthage for thirdparty libraries. Storyboards opens faster and without this error.
Note that the storyboard I am testing is empty.
This turned out to be stupidity on my part. I had a script that was killing certain processes on my Mac over and over and it turns out that was my issue. When I removed it everything worked as normal again.
This might be hard to diagnose without seeing the project, but Xcode keeps adding tons of warnings to my storyboard. It is a source controlled project, and if a team member cleans up all the warnings, pushes, and I pull, the warnings go away but as soon as I open storyboard, they reappear and they do not go away when I do the standard Update Frames option.
A lot of them seem to have to do with Stackviews, but I'm just confused why my coworkers can get the warnings to disappear and I cannot.
Has anyone experienced anything like this, or have any tips on how to approach solving this?
I was using Xcode 7.3 but after updating to 7.3.1 the problem still persists. Running OS X 10.11.6
Edit: Just to add some specifics, when I look at the source code versus my local code, it basically adds a ton of "Misplaced" tags, and a lot of values are changed by 0.5 or 1 pixel.
I do have the exact same issue when working with others on the same storyboard. It will happen every time you open (or another colleague) the storyboard. Here are some advises to avoid this :
When I open the storyboard, I know it will provoke this warnings. So if I don't add anything, before pushing a new commit, I reset any changes on the storyboard
I've come up with another good solution : using storyboard references as much as I can. So what I do is basically creating a storyboard for every flows (sometimes you can even have one storyboard for one controller). That way, when I work on a part of a project, it won't generate warnings on the totality of the storyboard. It avoids epic merge with many conflicts, it is easier to maintain, and it's faster to work on a small storyboard than on a huge one (Xcode is powerful, but when you have big storyboard, at a certain point it will lag).
But to answer to your question, I think everyone have that same issue when working on big projects, hopefuly apple will solve that one day, but for the moment you have to set good practices with your team. This is the only way to avoid wasting time at every pull ;) (at least for me, maybe someone has a better solution).
I am working on a fork of the Xbox HID project (to allow greater configuration of the controller) and came across a really strange issue.
The project is three projects, which I have grouped together under a workspace, which works well, it compiles them in order (kext, daemon and prefpane) and all works.
However, I decided to uncrustify the code (thanks Alcatraz!) and standardise the names and locations of source files. This required me to update the project as file paths changed.
Once this was all completed the PrefPane wouldn't load. For some reason it was instantiating and sending initWithBundle to an object that was NOT the File's Owner in the XIB.
After a lot of debugging and hair-pulling I discovered the object it was instantiating also happened to be the first file listed in the Compile Sources build phase. Once I moved the correct file to the top of that list the PrefPane once again launched and worked as expected.
That seems wrong, why does it need to compile this particular class first... better yet, why is it picking up only the first compiled class instead of the one specified in the XIB?
I am using Xcode Version 6.2 (6C131e) under OSX 10.9.5, however, I am using the OSX 10.6 SDK and have 10.6 as the deployment target.
I was having some other issues with the project in question, so I rebuilt all three projects and this issue went away.
I am guessing there was some sort of issue with the Xcode project itself as I believe it was probably upgraded from at least two previous major versions of Xcode.
Lesson here seems to be, rebuild the project files themselves and see if that fixes the issues!
I have a folder I imported into Xcode using the folder reference method. I'm having no trouble importing all the classes inside of it to other files and using them on the Storyboard however there is a quite annoying Xcode bug that makes it hard to do anything.
That Xcode suggestion system that has made me so fond of using Xcode and Objective C doesn't show up. So if I start to type "NS...." it doesn't recommend all the NS Classes! or Anything else for that matter.
How do I fix this?
After upgrading to Mavericks and XCode 5.0.2, my project out of nowhere started giving me File Not Found errors on headers included from my custom frameworks.
The solution was to remove and readd each custom framework from the project. I hope this helps if anyone else runs into the same problem.
I recently saw the same problem, framework headers suddenly becoming invisible to XCode. In my case, using XCode6 on Yosemite, it was because the symlinks (aka Aliases) (typically Headers, Resources, and the named library) in the framework had mysteriously lost their symlink metadata, and were seen by the finder as normal files. Because of this, the symlinks were not followed by XCode into the framework's Versions subfolders, and the files really were "not found".
Replacing the several frameworks which had this mysterious change (Parse & Crashlytics in my case) with fresh copies whose symlinks still showed their curved arrow in the finder cured XCode's confusion.
What makes this sort of failure particularly egregious is that the metadata is basically invisible to Git, so there's NO indication that your frameworks have been corrupted.
Yosemite subtly changed the behavior of symlinks, apparently changing their internal structure and deprecating some old Carbon APIs to them. This caused problems in apps and finder utilities that depended on the old Carbon APIs, including a favorite of mine "FinderPop" (since updated to correct the problem), so it's not entirely a surprise that Yosemite might occasionally manage to corrupt existing symlinks.
I had a similar issue and the problem was because of "spaces" in the parent folders of the items that I added.
Check https://stackoverflow.com/a/25009037/1071320
Just leaving this here in case some one else faces the same problem.