Skip to content

Instantly share code, notes, and snippets.

@dodikk
Last active August 29, 2015 13:57

Revisions

  1. dodikk renamed this gist Apr 1, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. dodikk revised this gist Apr 1, 2014. 3 changed files with 21 additions and 1 deletion.
    1 change: 0 additions & 1 deletion FactoryBlock.h
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    @protocol MyBlockProtocol;
    typedef id<MyBlockProtocol>(^MyFactoryMethodBlock)( NSString* )objectId

    6 changes: 6 additions & 0 deletions MyBlockProtocol.h
    Original file line number Diff line number Diff line change
    @@ -5,5 +5,11 @@

    -(MyFactoryMethodBlock)factoryMethodBlock;

    // having a conflict
    -(id<MyBlockProtocol>)createInstanceById:( NSString* )instanceId;

    // what's wrong here?
    -(instancetype)createInstanceById_2:( NSString* )instanceId;

    @end

    15 changes: 15 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #import <MyLibrary/MyBlockProtocol.h>


    @protocol MyChildBlockProtocol<MyBlockProtocol>

    -(MyFactoryMethodBlock)factoryMethodBlock;

    // having a conflict
    -(id<MyChildBlockProtocol>)createInstanceById:( NSString* )instanceId;

    // what's wrong here?
    -(instancetype)createInstanceById_2:( NSString* )instanceId;

    @end

  3. dodikk created this gist Apr 1, 2014.
    5 changes: 5 additions & 0 deletions FactoryBlock.h
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@

    @protocol MyBlockProtocol;
    typedef id<MyBlockProtocol>(^MyFactoryMethodBlock)( NSString* )objectId


    9 changes: 9 additions & 0 deletions MyBlockProtocol.h
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #import <MyLibrary/FactoryBlock.h>


    @protocol MyBlockProtocol

    -(MyFactoryMethodBlock)factoryMethodBlock;

    @end