iCarousel class doesn't work with ARC on xcode 4.2 & mac os 10.6 - icarousel

I'd like to include the iCarousel class and use it to make a gallery,
but the problem is that it doesn't work, if i include it.
I tried to use it with ARC and without - no effect.
Xcode finds about 20 errors in iCarousel.m :
for all messages like [self stopAnimation], [self layOutItemViews], [self ....] ..
it's written "ARC receiver type 'iCarousel' for instance message doesn't declare a method with selector..
i work on xcode 4.2 and Mac OS X 10.6.8
I download this tutorial http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-creating-an-awesome-carousel/
and it works, but there's no iCarousel effect - just a scroll with the list of images.

iCarousel doesn't support Xcode 4.2 or Snow Leopard any more. The minimum supported version is 4.3 on Lion.
If you want to run it on 4.2 (bearing in mind that Apple no longer accept apps to the app store that are built with 4.2) you can download an older version from this page:
https://github.com/nicklockwood/iCarousel/tags
I believe version 1.6.1 and earlier worked on 4.2, but if you still get errors with it, just keep downloading an earlier version until you find one that works.
EDIT: To be clear, apps built using iCarousel do still support Snow Leopard, but you cannot develop using Snow Leopard.

Related

"Parse issue: Unknown type name" error after upgrading XCode

After I upgraded my Mac OS X to Mountain Lion (all the way from Snow Leopard) and XCode 5 (all the way from XCode 3.2) I can no longer build a C++ project that I used to build in XCode successfully. I get loads of errors now all saying "Parse issue: Unknown type name *" for different objects. I tried an older version of XCode (4.6) and set the SDK to Mac OS X 10.7. This problem was solved but not using the latest version of XCode caused other problems.
To be specific, the errors (at least the first ones) seem to be related to Carbon graphic library. I don't know if that matters. I know that Carbon is somehow outdated but an official release of the application I'm extending runs on Mac OS 10.8 so I wonder why I can't build the code on 10.8.
What can be the cause of this error? The code is big and is not written by me so changing it is not an option. I really need to build it on XCode 5 or else I should downgrade my OS!
Several things that have been long deprecated in Carbon were finally removed in the Mac OS X 10.7 SDK.
You will need the Mac OS X 10.6 SDK to build your project. Apple stopped automatically including older SDKs with newer versions of Xcode but you can download older Xcode versions (from Apple's Developer site) and one of them...maybe Xcode 4.3 or so...will have the 10.6 SDK.
In order to use an older SDK with a newer Xcode, you must install it manually. The correct location is:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
Also note, any upgrade to Xcode (such as an update downloaded from the App Store) will obliterate your manually-installed SDKs. I recommend archiving the ones you need somewhere else so you can replace them as needed.

How do I get back c++0x/c++11 support for Mac OS X 10.6 deployment using Xcode 4.6.2 thru 7.1.1

I heavily use the c++0x/c++11 features in my project, particularly code blocks and shared pointers. When I upgraded my OS to 10.8 Mountain Lion (Edit: From 10.7), I was forced to upgrade Xcode. In upgrading Xcode, I lost the ability to compile my c++ project for deployment on 10.6 systems as I get the following error.
clang: error: invalid deployment target for -stdlib=libc++ (requires Mac OS X 10.7 or later)
It appears that Apple is trying to force people to upgrade by not allowing developers to support Snow Leopard. This makes me angry. Arrrggg!!!
What can I do?
EDIT: After several comments back and forth, it should be made clear that 10.6 does not ship with system libc++ libraries. As a result, simply being able to build a libc++ project for 10.6 deployment is not enough. You would also need to include libc++ binaries with your 10.6 distribution or statically link to them. So lets continue with the premise that I am already doing that.
UPDATE 1: This question was originally intended for use with Xcode 4.5.2 (the latest version at the time the question was asked). I have since upgraded to Xcode 4.6.3 and have updated the question and answer to reflect that.
UPDATE 2: I've since upgraded to Xcode 5.0.2. The technique listed in the selected answer below still works as expected.
UPDATE 3: I've since upgraded to Xcode 5.1. The technique listed in the answer below does not yet work for this version!
UPDATE 4: I've since upgraded to Xcode 6.0.1. The technique listed in the selected answer below appears to be working again.
UPDATE 5: I've since upgraded to Xcode 7.1.1. The technique listed in the selected answer below appears to be working again, with one important caveat. You must disable Bitcoding used for AppThinning since the opensource LLVM version doesn't support it (nor should it). So you will need to switch between the open source and Apple LLVM clang in order to compile for both 10.6 and tvOS/watchOS (since Bitcoding is required for those OSes).
Apple has decided to only officially support libc++ on 10.7 or higher. So the version of clang/llvm that ships with Xcode checks to see if the deployment target is set for 10.6 when using libc++, and prevents you from compiling. However, this flag is not included in the open source version of clang/llvm.
Take a look at this thread:
http://permalink.gmane.org/gmane.comp.compilers.clang.devel/17557
So, to compile a project that is using c++11 for 10.6 deployment, you need to give Xcode the open source version. Here is one way of doing it:
Download the open source version of clang from here (use LLVM 3.1 for Xcode 4.5.x; use LLVM 3.2 for Xcode 4.6.x; use LLVM 3.3 for Xcode 5.0.x; use LLVM 3.5.0 for XCode 6.0.1; use LLVM 3.7.0 for XCode 7.1.1):
http://llvm.org/releases/download.html
Make a backup of Xcode's default clang compiler and put it in a safe place (In case you screw up!)
This is located at:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Replace the default clang compiler with the one you downloaded from [1]
chown the clang binary for root:wheel with sudo chown root:wheel clang from the bin directory listed in [2].
Startup Xcode and compile!
UPDATE #1: This technique does not currently work for Xcode 5.1 or newer, which relies on LLVM 3.4. When I get some more time, I will try and find a solution to post here. But if someone comes up with a solution before me, they should post it as an answer.
UPDATE #2: Unfortunately I can't remember if I ever found a solution for Xcode 5.1, however I can confirm that the technique does still work for Xcode 6.0.1. I haven't tested on versions newer than that, but it could still work.
UPDATE #3: This technique appears to still work with XCode 7.1.1 using LLVM 3.7.0. However, the open source LLVM clang does not support Bitcoding. So you will need to switch between the open source compiler and Apple's compiler in order to develop for both 10.6 and tvOS/watchOS (which require Bitcoding).
P.S.: The Mac OS X binaries for LLVM 3.4 and 3.5.0 are listed as "Clang for Darwin 10.9" at www.llvm.org/releases/download.html rather than as "Clang Binaries for Mac OS X" in previous versions.
While Xcode 4.5.x is the current default version on OS X 10.8, you can have other, older versions of Xcode, such as Xcode 3.2.6 for OS X 10.6, available on 10.8 as long as you have access to their installers. You will need to ensure you install each one to a unique directory. Also, one thing you can't or shouldn't do is to install the Command Line Tools component or installer package of older Xcodes onto your 10.8 system, i.e. not into /usr or /System/Library. You can use the xcodebuild, xcode-select, and xcrun command line tools to access non-default Xcode components. See their man pages for more info. Older versions of Xcode are available to registered users of developer.apple.com
UPDATE: Based on your subsequent comments, I believe I did miss the point of the question and also that you had answered your own question. I think what you are saying is that you upgraded from 10.7 to 10.8, not from 10.6 to 10.8 as I assumed. You also did not make clear in the original question that you were distributing your own version of Apple's libc++ and friends from 10.7 with your own app. Apple does not make it easy in Xcode to do something like that since it has long been Apple's policy to discourage static linking with libs or distributing duplicate libs (which in some cases could violate license terms). There are good reasons for that policy.
The bottom line is that libc++ is only shipped with OS X 10.7 or later systems. There never was Apple support for libc++ in 10.6, so it's misleading to say it was removed. If you want to supply an app that is deployable on 10.6 and later systems and depends on libc++, the safest approach is to build your own clang/llvm and libc++ targeted for OS X 10.6 and use that to build your project. There are various ways to do that, probably the easiest is to use the MacPorts versions and set the deployment target in MacPorts for 10.6. Or build it all from scratch yourself. But modifying the clang compiler within Xcode 4.5 is a bad idea. And copying Apple libraries to one's app is generally a bad idea.
If you have a solution that works for you, great. But I would not recommend it to others.

Building 10.7 Lion apps with Xcode 3.2.6 - Do they work

Long time browser, first time asker...
Maybe you can help. I've searched and searched, and seen it asked a few times, but it always turns into a "Xcode 4 sucks" debate.
QUESTION: Do projects built in Xcode 3.2.6 on OSX 10.7, using "Current OS" as base SDK and 10.5 as the target actually work with all versions of OSX?
I had Xcode 3.2.6 on my 10.6 OSX build. I upgraded to Lion, and installed Xcode 4. Xcode 3 was moved to /Developer-3.2.6.
Now some of my old projects don't work in Xcode 4 and I personally prefer 3 (I GIT via command line anyway). But if I build in Xcode 3, it lets me pick "Current OS" as the base SDK, and 10.5 as the target. Am I right in presuming Xcode 3 will now build 10.7, 10.6, and 10.5 apps in 1 binary?
Your applications built with Xcode 3.2.6 should run on 10.7. They won't take advantage of any features added in 10.7, like fullscreen windows.
As long as your code doesn't call any methods added in 10.6 or 10.7, your application will run on 10.5 and above if you set the deployment target to 10.5. You don't have to specify Intel only to run on 10.5 through 10.7.

How to fix problem with version mismatch of iPhone 4.3.4 and IOS SDK

I upgraded my iPhone to 4.3.4 (8K2) and I can no longer build my app.
In the organizer, I get the following error:
The version of iOS on “Jeff Bonta’s iPhone” does not match any of the versions of iOS supported for development with this installation of the iOS SDK. Please restore the device to a version of the OS listed below, or update to the latest version of the iOS SDK; which is available here.
OS Installed on Jeff Bonta’s iPhone
4.3.4 (8K2)
Xcode Supported iOS Versions
4.3.4 (8K2)
4.3.3 (8J2)
4.3.2 (8H7)
4.3.1 (8G4)
So, it acknowledges that I have 4.3.4 installed on my iPhone and it says that Xcode supports 4.3.4, but it also says that the version on the iPhone does not match any of the versions supported for development with this SDK. Very confusing.
Before I rebooted my iPhone, I got errors in the debugger console:
iphone unable to load symbol file:
Other users have had this problem with version 4.2.1 and resolved it by:
Deleting the folder /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1/ and restarting Xcode.
I could not get this to work because I could not delete the folder .../4.3.4 (8K2). I figured out how to delete this folder, but not until after I rebooted my iPhone.
Any suggestions? I am completely stuck.
I had a similar issue, here was my work process.
Close XCode
Disconnect iPhone
Delete 4.2 - to the latest version folders (as
shown in the other post - If you cant do it through the GUI, go in through terminal and sudo delete it.)
Now I went to install Xcode again, but I use Lion now and it said "update xcode" when I went to install.
Install the new updates and open Xcode.
Plug in the iPhone and open Organiser (if it doesnt do it automatically)
Wait a minute
before it recognises the iPhone, it should then ask you to port the
files across.
Click on the project file in Xcode, and then set the
version to 4.3.4 (or 4.3.5 if you updated) manually, as its grayed out and doesn't recognise the device until you do.
Clean the project and then build.
Let me know how you get on :)
I have both Xcode 3.2 and Xcode 4 installed. 3.2 gave me the same error on an iOS5 iPad. I deleted the folder with 'sudo rm -rf /Developer/blah/balh/' and then opened Xcode 4 with the iPad connected, Xcode 4 did some magic and a message 'Clean Manager succeed' appeared on the status bar. Closed 4, opened 3.2 and voila! There was my device ready again.
Hope this helps.

Stanford CS106B C++ libraries in XCode 4

I'm trying to use the Stanford CS106B C++ libraries, like simpio.h and genlib.h. I'm using XCode 4 (this is a beta version btw) and Mac OS X 10.6. I installed the libraries, but they don't seem to be showing up when I try to create a new project in XCode. Is there something different I should be doing with XCode 4 to get these libraries in?
There's probably a pretty basic solution to this problem, and if it were just a matter of frameworks in iOS, I could definitely get that to work with this version of XCode, but I've not really done this with C++ and XCode before, so I'm stuck.
Update on 7/20/11
I found a link to download the Xcode 2.5 tools as well as Xcode 3.0, both of which are described in the handout. I'm downloading both of them now. Does anyone know if Xcode 3.0 and 4.2 will run fine on the same machine?
Yes, multiple versions of Xcode work fine together. During the install, after the "Select a Destination" screen, you see a screen with the packages that will be installed. Click "Developer" folder to change to a custom location for each different Xcode version. The other tools (system and UNIX) cannot be moved.
After you have Xcode installed, just install your libraries in the usr/lib folder under your custom Xcode folder, and you should be good to go.