PDA

View Full Version : Help building a screensaver on Mountain Lion




danhoo
Aug 3, 2012, 03:40 PM
Hi,

I was wondering if anyone could do me a huge favor. I've got a screensaver XCode 4 project that builds on Snow Leopard, and the resulting screensaver runs successfully on 10.5 through 10.7. However, on 10.8, people are getting an error saying the screensaver is not compatible.

Unfortunately, I don't have a Mountain Lion capable dev system. I'm not even really sure what the issue is. What I'm wondering is if anyone has Mountain Lion and XCode properly configured, if I sent a project, could you try building it, seeing if it works, and then sending me back the resulting screensaver?

-- Dan



natas
Aug 4, 2012, 03:53 PM
Hi danhoo,

I'm currently facing the same problem!

I developed a screen saver on Snow Leopard and it was working fine. But now that I've upgraded to Mountain Lion it stopped working. On System Preferences, I still see my screen saver but the preview window is black and just shows this trimmed text:
"cannot use the MY_SCREEN_SAVER with this version of Mac O
e contact the vendor to get a newer version of the screen saver."

If I click Preview, I just get a black screen and back at the System Preferences the "Screen Saver Options..." button is disabled.

I still get this after rebuilding the screen saver in Mountain Lion with Xcode 4.4 and changing the "OS Deployment Target" to "OS X 10.8".

I'll keep trying to figure this out and will post if I find a solution.

danhoo
Aug 5, 2012, 12:12 PM
Hi Natas,

Thanks for your reply -- yeah, that's exactly the same error message that my users are getting on Mountain Lion, the "contact your vendor to get a newer version of this screensaver". When I check places like macupdate.com, it seems like we're not the only ones experiencing this.

That's particularly helpful information that if you build it on 10.8 with the 10.8 deployment target, it still results in this error! Please do let me know whatever you find out. I've been reaching out to other devs I know (so far, no responses) and if I find out anything, I'll post it too.

geowar
Aug 13, 2012, 05:50 PM
After I clicked the "validate settings" button (in Xcode 4.4) my screensaver built and ran just fine on Mountain Lion. I didn't save my pre-10.8 project to diff against or I could tell you what changed. Sorry.

geowar
Aug 15, 2012, 02:44 PM
For your screensaver to run on Leopard (10.6) thru Mountain Lion (10.8):
GCC_ENABLE_OBJC_GC = supported

danhoo
Aug 16, 2012, 03:56 PM
For your screensaver to run on Leopard (10.6) thru Mountain Lion (10.8):
GCC_ENABLE_OBJC_GC = supported

Thanks Geo! That might be it -- I've got GC set to "required" not "supported". I'll give that a shot.

natas
Aug 19, 2012, 04:22 AM
Hey guys,

Thank you for the tips, but it is still not working for me :s

I validated the settings and checked GCC_ENABLE_OBJC_GC (which was already set to "supported"), but I still get the same behaviour.

Did these steps fix your issue Danhoo?

danhoo
Aug 21, 2012, 12:04 PM
Hi Natas. Yes, switching from GC required to supported appears to have fixed the problem for me (confirmed by a couple people running 10.8). Here's a screenshot of my build settings for GC (in XCode 4):

http://i.imgur.com/xwjf6.png

I think that might even be overkill, as I was also able to verify with one user with a build I did on Snow Leopard using XCode 3, where I simply switched the 10.6 GC setting to supported instead of required.

Natas, feel free to send me a PM and I can email you my project if you want to compare the build settings to yours.

Madd the Sane
Aug 29, 2012, 06:50 PM
Hi Natas. Yes, switching from GC required to supported appears to have fixed the problem for me (confirmed by a couple people running 10.8). Here's a screenshot of my build settings for GC (in XCode 4):

Image (http://i.imgur.com/xwjf6.png)

I think that might even be overkill, as I was also able to verify with one user with a build I did on Snow Leopard using XCode 3, where I simply switched the 10.6 GC setting to supported instead of required.

Natas, feel free to send me a PM and I can email you my project if you want to compare the build settings to yours.

You're overcomplicating it: 64-bit 10.6 screen savers will run if you set the Garbage Collection to supported: this injects code and tells the Objective-c runtime that the code can run either under garbage collection or without it. If it were me, I'd simplify the whole thing by having the whole of Objective-C garbage collection set to supported.
Just paste the following line in the build settings window:
GCC_ENABLE_OBJC_GC = supported

But your way will work if you only target 10.8 or 10.6.
In fact, my screen saver from 10.6 built using that setting works fine under ML.

danhoo
Sep 2, 2012, 01:06 PM
You're overcomplicating it: 64-bit 10.6 screen savers will run if you set the Garbage Collection to supported: this injects code and tells the Objective-c runtime that the code can run either under garbage collection or without it. If it were me, I'd simplify the whole thing by having the whole of Objective-C garbage collection set to supported.
Just paste the following line in the build settings window:
GCC_ENABLE_OBJC_GC = supported

But your way will work if you only target 10.8 or 10.6.
In fact, my screen saver from 10.6 built using that setting works fine under ML.

Yes, that's basically what I ended up doing anyway -- just use GC Supported for everything. However, I think the issue stems from screensaver developers such as myself originally using GC Required for SL due to a (now out of date) recommendation from Apple:

https://developer.apple.com/library/mac/#qa/qa1666/_index.html

This requirement changed from SL to ML, so thus some of us ended up with screensavers that would mysteriously not load.

natas
Sep 22, 2012, 03:41 PM
Hi Natas. Yes, switching from GC required to supported appears to have fixed the problem for me (confirmed by a couple people running 10.8). Here's a screenshot of my build settings for GC (in XCode 4):

Image (http://i.imgur.com/xwjf6.png)

I think that might even be overkill, as I was also able to verify with one user with a build I did on Snow Leopard using XCode 3, where I simply switched the 10.6 GC setting to supported instead of required.

Natas, feel free to send me a PM and I can email you my project if you want to compare the build settings to yours.

Hey danhoo,

I'm glad that fixed your issue. Unfortunately, mine remains unfixed.

I can't see the option that you show on the image: "Objective-C Garbage Collection" I guess that's because I'm using the compiler "Apple LLVM compiler 4.1", but I already tried setting a User-Defined Setting for GCC_ENABLE_OBJC_GC and that didn't work.

I also tried setting -fobjc-gc in Other C Flags to no avail. I'm starting to guess this is some other problem.

It would be great if I could have a look at your configs or try to run your screensaver. I tried PMing you, but I get a message saying I don't have permission to do that... I've befriended you, maybe that will allow me to PM you.

Thanks for the help guys!

danhoo
Sep 23, 2012, 07:26 PM
Natas, I can't seem to send you a PM either (even though I've got all the appropriate options checked in my user settings). Ping me at danhoo (at) gmail (dot) com.