Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Objective-c > About Objective...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 995 of 1042
Post > Topic >>

About Objective-C protocols

by fg <fg_NOSPAM@[EMAIL PROTECTED] > Jun 23, 2008 at 08:22 AM

Hi All,
I think I'm confused about objective-c protocols and I'm asking here to 
clarify myself.

In my mind protocols are something like interfaces of Java, C# and so on 
so if I'd like to create a Factory Method I suppose it have to return a 
protocol type (something like "+(Protocol*) CreateObject;") but the 
compiler give to me an error about using protocol in this way.

I known Objective-C is dynamic typed language so my factory can return a 
"id" type and consumer can check if the object is kind of some protocol 
but I find this a "dirty" solution.

Am I misunderstanding something about "filosofy" of a dynamic typed 
language? Are not useful standard design patterns in this kind of 
languages (and there are others)?

Many thanks
Fabrizio
 




 3 Posts in Topic:
About Objective-C protocols
fg <fg_NOSPAM@[EMAIL P  2008-06-23 08:22:06 
Re: About Objective-C protocols
cb@[EMAIL PROTECTED] (Ch  2008-06-23 09:17:08 
Re: About Objective-C protocols
fg <fg_NOSPAM@[EMAIL P  2008-06-23 09:57:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 9:57:20 CDT 2008.