Cast an instance of a class to a @protocol in Objective-C

The correct way to do this is to do: if ([self.myViewController conformsToProtocol:@protocol(MyProtocol)]) { UIViewController <MyProtocol> *vc = (UIViewController <MyProtocol> *) self.myViewController; [vc protocolMethod]; } The UIViewController <MyProtocol> * type-cast translates to “vc is a UIViewController object that conforms to MyProtocol”, whereas using id <MyProtocol> translates to “vc is an object of an unknown class that … Read more

binary protocols v. text protocols

Binary protocol versus text protocol isn’t really about how binary blobs are encoded. The difference is really whether the protocol is oriented around data structures or around text strings. Let me give an example: HTTP. HTTP is a text protocol, even though when it sends a jpeg image, it just sends the raw bytes, not … Read more

Simple explanation of clojure protocols

The purpose of Protocols in Clojure is to solve the Expression Problem in an efficient manner. So, what’s the Expression Problem? It refers to the basic problem of extensibility: our programs manipulate data types using operations. As our programs evolve, we need to extend them with new data types and new operations. And particularly, we … Read more

Difference between TCP and UDP?

TCP is a connection oriented stream over an IP network. It guarantees that all sent packets will reach the destination in the correct order. This imply the use of acknowledgement packets sent back to the sender, and automatic retransmission, causing additional delays and a general less efficient transmission than UDP. UDP is a connection-less protocol. … Read more

How do I create my own URL protocol? (e.g. so://…) [closed]

The portion with the HTTP://,FTP://, etc are called URI Schemes You can register your own through the registry. HKEY_CLASSES_ROOT/ your-protocol-name/ (Default) “URL:your-protocol-name Protocol” URL Protocol “” shell/ open/ command/ (Default) PathToExecutable Sources: https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml, http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)