How to go about making audio units since Xcode 4.3? - xcode

I noticed since Xcode 4.3, the audio unit templates are gone and the audio unit headers and helper apps are a separate download from Apple's website.
I have no idea what to do with the downloaded folder... I tried putting AU Lab And HALLab in Xcode.app/Applications and they don't show up in the new developer tools menu; I tried placing the CoreAudio folder with the headers in Xcode.app/Developer and even recreating /Developer in my root and Xcode doesn't see AUEffectBase.h anywhere (unless I actually add the file).
I saw someone's post on how to come up with a new from-scratch template but I won't even go there yet since Xcode doesn't even find the headers right now.
Any ideas on how to go about making it all work again?
And about the templates.. I can forget about them right, meaning, the ones we used to have from Apple?
Thanks!

If they are in your project, and referenced by Xcode, then you will have to update those project references. Xcode may refer to them as absolute path, relative to project, relative to SDK and a few others.
At this point, you might consider creating a static library for these dependencies, if you have multiple AUs to build out. Then you just create a static lib to link to, rather than managing a handful of sources per AU.
Templates: It appears they have been removed (temporary? permanent? idk). I moved off distributed template dependence years ago. Perhaps you can scan or hit the CA-API list and see if a dev has one handy.

Related

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.

How do I open project version 1.0 with xcode 4.2?

I downloaded this Xcode project(version 1.0 as in contents.xcworkspacedata) from here
When I try to open it, got this error:
Failed to load project at '.../Lesson31_OSXCocoa/Lesson31_OSXCocoa.pbproj', incompatible project version.
How do I open project version 1.0 with xcode 4.2?
You're better off trying to find a newer tutorial, or just studying the code as-is, without expecting to build and run it.
Judging by the modification dates, this code is almost ten years old. Even if you can get a modern version of XCode to open it, there's no reason to think that the headers, libraries, etc., that it needs to compile and run will still be compatible. Moreover, ten years is a long time in software terms. While some of the content might still be applicable, it certainly won't be anywhere near the cutting edge (which itself won't be new by the time you've mastered it).
All that said, if you're really intent on working with that project file in XCode 4.2, the best way is probably to convert it the same way a continuously developed project would have: XCode by XCode.
You can download older versions of XCode from Apple here (requires free Apple developer account).
Some older version will be able to import that file and update it to a newer format.
Assuming you don't stop at that point and use that version of XCode, you can repeat the process with the updated project file and ever-newer versions of XCode until you've arrived at version 4.2.
Relatively easy to make a new project and add the appropriate files to it. Took less than 10 minutes (had to update the code in a few places). Note that I didn't spend much time cleaning up this old code - quite a few deprecated warnings. But it runs and works. I have Xcode 4.3.2 installed but hopefully you'll be able to open it with 4.2. Here's a link to it: Lesson31.zip
Note that the process for doing this (so you can do it for any others), is to create a new Mac OS X Cocoa Application project, add the files (except main.m) from the old project to the new project, and then add necessary libraries to fix link errors (OpenGL Framework). If there's a nib then you can open that in Xcode and copy the window with view and controller out of that project and paste them into the .xib file created with the new project. Then fix compiler warnings/errors as necessary (add a few (char*) coerces, remove reference to std::ios::nocreate which doesn't seem to be available, etc).

How do I build frameworks in Xcode?

I'm trying to use the GData framework, so I downloaded it and it came as an Xcode project so I assumed I needed to build it. So I opened it up and and clicked run and it compiled fine, but where do I go to access the .framework it created? I'm new to frameworks and have only been using xcode for a month or two so you'll have to excuse my lack of knowledge about it.
The documentation will help you
Anyway, by default the target is GDataUnitTest, just change it to GDataFramework. Once you compile it you will find the framework in the folder of the XCode Project called target.

How do I get MailCore to work correctly?

I'm trying to build MailCore into my app but I keep getting
"_OBJC_CLASS_$_CTCoreAccount", referenced from:
That is the only error I'm getting and CTCoreAccount is in the project.
In order to use mail core framework, visit the link follow step by step process and you are done.
I have an answer. It is not "The Answer" but I have an answer and it worked.
Eidt: For this: After a slew of issues, I've realized that "this" particular fix is that you need to add libmailcore.a to the frameworks. It keeeps getting deleted by XCode, or you may ahve added the MailCore Framework instead.
Started a fresh project, erased everything by removing application files to trash, then deleting references. "Added" via group (unsure if it matters) all my folers/files from the project I was trying to.
Had to tell it where the pch and Info.plist were, (essentially pointing it to my old project). Re-added all frameworks, and voila, it compiled.
I'm suspecting XCode 4.5 has different framework settings as far as library paths and valid flags for linker, etc. But nothing I tried regarding that fixed it. I would love to do this more direclty, old project is on 4.3, and won't be upgrading it if this is happening. Anyway, up and running, hope others are soon too. Would like real answer myself

Resources