Re: blocks and id
Re: blocks and id
- Subject: Re: blocks and id
- From: Mike Abdullah <email@hidden>
- Date: Wed, 12 Dec 2012 22:11:39 +0000
On 12 Dec 2012, at 14:14, Jean Suisse wrote:
> On 12 déc. 2012, at 13:02, Mike Abdullah <email@hidden> wrote:
>
>> Why does your code care if some unknown object is a block? This is a strong sign of a bad design.
>
>
> As far as I am concerned, I can think of at least two or three legitimate reasons to care wether an unidentified object is a block or not.
> But you seem pretty certain. So you must have had more informations than the rest of us
> – sorry, just thinking out loud.
No extra information; just experience and a knowledge of the Cocoa APIs.
>
> To actually answer the question, I fear that not much can be done.
> Personally, I would go for Andreas' current solution and if the app is commercial, I would make sure to test & fix it before each public MAC OS release, so that users can upgrade the app before upgrading the system (and also check the OS version at each launch to detect if they didn't upgrade).
Seriously, you'd recommend a fragile solution that relies on private API and needs regular testing, over simply having two or more methods?
>
> Otherwise, maybe this could work depending on the situation:
> -(whatever)processSomething:(id)something andKeepInMindThatsABlock:(BOOL)isBlock;
Well once you've done that, surely you might as well just have two separate methods?!
_______________________________________________
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