Re: IB_DESIGNABLE - anyone got it to work?
Re: IB_DESIGNABLE - anyone got it to work?
- Subject: Re: IB_DESIGNABLE - anyone got it to work?
- From: Roland King <email@hidden>
- Date: Wed, 13 May 2015 07:37:38 +0800
> On 13 May 2015, at 07:04, Graham Cox <email@hidden> wrote:
>
>
>> On 13 May 2015, at 1:22 am, Sean McBride <email@hidden> wrote:
>>
>> After some difficulty, yes. But it seems to only support direct subclasses of NSView, not NSControl for example. What's your superclass?
>
>
> One possible issue in this case is that the first time -drawRect: for any instance is called, it calls a class method to load the image from a resource, which is then retained indefinitely. This lazy loading is why the first draw takes 10mS and later ones only 2, but since it’s being invoked on a thread I did need to add some synchronization to the class methods that perform the loading. This seemed to make IB a little happier, in that one instance actually drew as expected in IB, though others still report a time-out and the sometime crash is still happening. (Prewarming the images didn’t make any difference anyway).
>
How are you loading the resource? [ NSBundle mainBundle ] .. ] probably won’t work, you need to use bundleForClass. Since that’s now true for resources in frameworks too I’m trying to use that pattern myself.
> I’ve noticed a load of other problems relating to the IBInspectable attribute on properties as well, such as removing the IBInspectable attribute does not remove the value in the nib itself, causng the property to be initialized with a stale and incorrect value. It also doesn’t handle simple enumerated type properties which is a pretty serious limitation. Also changing any of these property values in IB doesn’t reflect the change in the drawn view, though it might be because of the other problems I’m having with that.
Definitely live-updating works The other two things, lack of enumerated types and IB not removing the property are definitely issues, especially the enumerated types which would be very useful.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden