Xcode not verifying code or suggesting classes in certain classes - xcode

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?

Related

GPUImage won't compile on iOS 12

I have these errors:
Cocoa.h File Not Found (in GPUImageView.h)
Unknown Type Name: **NSOpenGLContext, CVOpenGLESTextureCacheRef (GPUImageContext)
Now, I tried to fix all these errors, but ended up making things worse.
I know OpenGL ES is deprecated in iOS 12, but as I understand deprecation, it should still be working for the moment, right?
For error #1, I don't understand what's a MAC OS framework (cocoa.h) doing in here (some of the references are not surrounded with #IFDEF MAC_OS statements).
As for error #2, these types are defined within the AppKit framework (also a MAC_OS framework, not an iOS framework).
I have considered switching to GPUImage2, but it's a ton of work as it's not as easy as swapping the frameworks, I'll have a lot of code to rewrite. I also see Brad Larson (the semi-God behind this framework) has already started working on GPUImage3 which will use Metal instead of OpenGL ES but it's still work-in-progress but it won't be a simple swap from GPUImage v1 to GPUImage v3.
I found a way to fix it. Maybe it will help someone with the same problem. The GPUImage main folder contains the iOS and the MAC projects.
Go to the framework folder, and delete the GPUImageMac.xcodeproj file.
Then go to the Source folder located within the framework folder, and delete the whole folder named Mac.
Clean your project and rebuild. VoilĂ !
Good luck!

Refactoring Images in Xcode 7?

It is possible to refactor images in Xcode 7? I have a lot of images and I want to change their names. But I do not want to change every reference to this image manually.
I cannot find anything at Google.
Xcode can only refactor C and Objective-C code for now. You will have to do the refactoring manually, or simply using Find > Find and Replace in Workspace...
To avoid potential crashes that might be caused if you make a mistake, use R.swift, which makes it similar to how it works on Android.

Xcode Source Compiling Order Issue

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!

Xcode 5.1 compiler errors after adding a framework

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.

AppleScriptObjc - Xcode 4.6.3 - Xcode No Longer Recognizes Created Outlets or Actions

Okay, log time reader, first time writer.
!!! NOTE: While reading this question, please bear in mind I am writing using AppleScript in a fresh Cocoa-Applescript project. I am NOT using straight Cocoa/Objective-C. !!!
With that out of the way.
I have been using Xcode and ASObjC for a while now and have developed quite a few productivity apps for myself, so I have a pretty good idea as to what I am doing and how it is supposed to work. However, this issue has me pulling my hair out!
A few weeks ago, I updated to OSX 10.8.4 (this is when I believe the issue started). Since then, Xcode no longer recognizes any outlets or actions I define in my AppDelegate file.
Here is an image illustrating the issue:
http://cl.ly/image/0a1b1T1O1O1m
"theLabel" should show under Referencing Outlets and "doAction" should show under Received Actions
This is especially strange when viewing projects created before the issue:
http://cl.ly/image/3J0m2a2q392r
The "!" to the right of each outlet states: AppDelegate does not have an Outlet named [outlet name] The Actions have a similar warning message.
I have done some Troubleshooting on the issue with no success.
Restarted Xcode - issue persists
created fresh project - issue persists
pulled all .plist files related to Xcode - issue persists
trashed DerivedData folder - issue persists
removed and reinstalled from App Store - issue persists
created fresh user account and project - issue persists
reset NVRAM - issue persists
tried on different computer - issue resolved
Issue seems to be isolated to this machine.
If anyone can help me with this, that would be awesome. Maybe I am just missing something important.
I'm usng OS X version 10.8.4 with Xcode 4.6.2.
I tried out what you said.
I made a new AppleScriptObjC project from the Xcode template with document-based application set to false, so Xcode create a new project for me with an AppDelegate.
I got the actions for the AppDelegate class to work both tying menu-items to First Responder and tying them directly to the AppDelegate.
I tried changing the name of the app delegate to "ThisIsTheDelegate". This didn't work until I also changed the name of the AppDelegate class to be "ThisIsTheDelegate" in Xcode's identify inspector.
I don't know if this is the problem that you are having or not.
You wrote in your original question that:
tried on different computer - issue resolved
So it must be something about your configuration.
When I first tried AppleScriptObjC in Xcode, I got some errors that were resolved on my computer by removing some osax files from
/Library/ScriptingAdditions
I don't know if this is the problem that you are having, but I removed them all and stashed them somewhere else for safe-keeping in case I needed them, and I haven't needed them yet.
I believe that these .osax scripting additions were installed by a third-party, namely Smile and Satimage.
I understand that there is some good functionality in these scripting additions, but Apple recommends that third-party developers don't even develop .osax scripting additions because they as so global.
What's better is to use Scripting Agents which are apps that aren't even in the picture unless you give them a tell command.
That's all that I can think of.

Resources