0

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

Paulw11
  • 108,386
  • 14
  • 159
  • 186
Ayane
  • 3
  • 2
  • AppKit is not an iOS framework. It is an OS X framework used for writing Mac apps. You cannot use it on iOS. – NobodyNada Apr 07 '14 at 22:05

1 Answers1

0

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.

dbulnes
  • 51
  • 4
  • Oooh interesting. The project I am working on is actually an ios app and I didn't see anything ever saying NSMatrix didn't work for it. So that's good to know. Also, since I am working by myself I didn't setup GIT but since I know this is a pretty common occurrence I will next time. I will check in the pbxproj though! Also what should I use for ios instead of NSMatrix? I was just trying to make radio buttons like in this example: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Button/Concepts/RadioButtons.html – Ayane Apr 08 '14 at 20:03
  • Okay, looked through the pbxproj file and didn't see any duplicates. I think I will just try to remake proj and re add the files I made >.> – Ayane Apr 08 '14 at 20:39
  • Appkit for Mac ~= UIKit for iOS. In iOS, instead of radio buttons you would use a UIPicker - https://developer.apple.com/library/ios/documentation/uikit/reference/UIPickerView_Class/Reference/UIPickerView.html I would absolutely 100% recommend Git, or any source control, for any size project, even small personal projects. It makes problems like this much easier to trace, and once you get used to the terminal commands or GUI, adds virtually no overhead to your workflow. – dbulnes Apr 08 '14 at 22:08
  • Another alternative would be to roll your own UIButton - http://mobisoftinfotech.com/iphone-uibutton-tutorial-radio-buttons/ – dbulnes Apr 08 '14 at 22:14