weak linking issues

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller, LCMark

Post Reply
monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

weak linking issues

Post by monte » Tue Oct 01, 2013 2:40 am

Has something changed with the build system? For some reason while I used to be able to weak link a class using the if([CLASSNAME class] != nil) method now I need to use the old class from string method.

I think LiveCode should be compatible with the newer method and indeed was until quite recently:
The base SDK for your Xcode project must be iOS 4.2 or newer. The name for this setting in the build settings editor is SDKROOT (Base SDK).
The deployment target for your project must be iOS 3.1 or newer. The name for this setting is MACOSX_DEPLOYMENT_TARGET (OS X Deployment Target).
The compiler for your project must be the LLVM-GCC 4.2 compiler or newer, or the LLVM compiler (Clang) 1.5 or newer. The name for this setting is GCC_VERSION (C/C++ Compiler Version).

I haven't gone back and tested old versions of LC to see where the change happened but wonder if it's related to the build automation somehow?
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 996
Joined: Thu Apr 11, 2013 11:27 am

Re: weak linking issues

Post by LCMark » Tue Oct 01, 2013 9:30 am

What error are you seeing when using the [CLASSNAME class] != nil approach?

The current settings on master haven't changed for a while and they conform to what is listed above (4.3/default sdk (latest)/llvmgcc42).

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: weak linking issues

Post by monte » Tue Oct 01, 2013 9:41 am

dyld error on the class... crashes at startup. But it seems to work fine using the class from string method.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 996
Joined: Thu Apr 11, 2013 11:27 am

Re: weak linking issues

Post by LCMark » Tue Oct 01, 2013 9:51 am

Is it a particular class, or all classes you previously used like this?

I'm a little puzzled - we've not done anything to my knowledge (consciously at least) which would break this... Although, that being said, I do recall us having issues using that form of weak-linking in the engine itself, but I think that was to do with needing to support different SDKs for different OS versions.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: weak linking issues

Post by monte » Tue Oct 01, 2013 10:03 am

Well the particular class that brought it to my attention was UIActivityViewController which is iOS 6.0 and was crashing in iOS 5.1.1. But I think it's a general thing. I guess it doesn't really matter as long as I know for the future but I'm positive I had it working before... For example, mergSocial used it and it degrades from the Social framework to the Twitter framework on iOS 5. So it was definitely working.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Engine Contributors”