Cannot use Kal with Xcode4
Hello,
I've been trying for quite a while now to use Kal with an Xcode4 project. I've tried both integrating into a normal project and the new workspace feature. I've now used both Xcode 4.02 and 4.1
These are the existing instructions for Xcode3. I've put the issues I'm face prefaced with a ******** :
2] Locate the "Kal.xcodeproj" file under "Kal/src/". Drag Kal.xcodeproj and drop it onto the root of your Xcode project's "Groups and Files" sidebar. A dialog will appear -- make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project" before clicking "Add".
******** Two issue. When I drag over or right-click 'add file' Kal.xcodeproj just shows up as a 'flat' file. I can't expand like you would a normal project. It just looks like a little project icon and thats it.
3] Now you need to link the Kal static library to your project. Select the Kal.xcodeproj file that you just added to the sidebar. Under the "Details" table, you will see libKal.a. Check the checkbox on the far right for this file. This will tell Xcode to link against Kal when building your app.
******** In Xcode 4 I select the project on the left side, then Target, then Build Phases. Select Target Dependencies and click the Plus. Nothing appears here. I can select the static library.
4] Now you need to add Kal as a dependency of your project so that Xcode will compile it whenever you compile your project. Expand the "Targets" section of the sidebar and double-click your application's target. Under the "General" tab you will see a "Direct Dependencies" section. Click the "+" button, select "Kal" and click "Add Target".
******** Where do I do this in Xcode 4 ?
5] Now you need to add the bundle of image resources internally used by Kal's UI. Locate "Kal.bundle" under "Kal/src" and drag and drop it into your project. A dialog will appear -- make sure "Create Folder References" is selected, "Copy items" is unchecked, and "Reference Type" is "Relative to Project" before clicking "Add".
******** This works fine.
6] Finally, we need to tell your project where to find the Kal headers. Open your "Project Settings" and go to the "Build" tab. Look for "Header Search Paths" and double-click it. Add the relative path from your project's directory to the "Kal/src" directory. While you are in Project Settings, go to "Other Linker Flags" under the "Linker" section, and add "-all_load" to the list of flags. You're ready to go. Just #import "Kal.h" anywhere you want to use KalViewController in your project.
******** This works fine.
So likely due to not being able to include the static library, I get these errors : Apple_Mach0_Linker_Error : KalViewController Apple_Mach0_Linker_Error : KalDataSourceChangedNotifications.
The examples do work. As far as I am aware my project Kal set up is the same.
Any pointers? Thanks.
In XCode 4 it works a lil bit different then before. First of all before using a static library you need to understand how this stuff is integrated. A very good introduction is given by clint harris at: http://www.clintharris.net/2009/iphone-app-shared-libraries/ I recommend you to read his guide. After that many things are more clear.
To get the Kal library into your project forget the old guide for XCode 3. In XCode 4 click on your project in the project navigator. Say add files to project and find the Kal.xcodeproj. file and add it. When you see the Kal Project under your project you are almost there. Now again select your project in the project navigator and go to build settings. there search for "Linker" and fill in Other Linker Flags: "-Objc and -all_load", also insert the path to the Kal directory in the Library Search Paths and the relative path from your project to the kal project under: "Header Search Paths". Thats it for Build settings.
Now go to Build Phases: Add the Kal static library to the target dependencies, also add the libKal.a to Link Binary with Libraries and at the end add the Kal.bundle to "Copy Bundle Resources".
Now if I didnt miss something your project can use Kal.
Let me know if you need anything else.
That worked great. Thanks for the detailed instructions. I did actually get it to work after my initial post by compiling the actual Kal project, then dragging the resulting .a file to my Xcode4 project. However that likely wasn't proper. Again, thanks.
That worked great. I really appreciate the detailed response.
Let me know if you need anything else.
Only if you have time. I hoped to add the time of an appointment in the table list view under the calendar, to the left of the title of the event. Ordinarily this would be defined in 'cellForRowAtIndexPath', which is in SimpleKalDataSource. This just appears to be filler however. Where is the actual cell text set ? I also tried playing around with tableView in KalViewController but test text I add doesn't show up.
Again, Thank You.
Jot
Thanks very much for that walkthrough and link, It really helped.
Hello I followed all the instruction of Raven but still importing Kal.h says its not found.. please help me :( and by the way can you send me a sample path of Kal directory and the relative path im using /Users/Alx005/Downloads/klazuka-Kal-b2e164c/src for the header search path and /Users/Alx005/Downloads/klazuka-Kal-b2e164c for the Library search path correct me if im wrong , and Kal.h appears when I type but still I dont know why does it says not found
sorry for the noob question please help me :(
Edit: I use user search path and it all works.. I wonder why
its working when i use #import "/Users/Alx005/Downloads/klazuka-Kal-b2e164c/src/Kal.h"
Alex, move the kal source files into the project > external folder then use something like this instead ${SOURCE_ROOT}/Classes/External/Kal
I have the same problem and no longer hayo alexx how to get me to accept it, really if anyone has any suggestions of what could be I would appreciate.
Already tried with ${SOURCE_ROOT}/Classes/External/Kal I still have the same problem