ios - How to declare generic type in Xcode 7 for blocks -


i did simple test generic type support in xcode 7 follow:

@interface mtbaselistviewcontroller <t> : uiviewcontroller  - (void )requestwithblock1:(void (^)(t data ))block; - (void )requestwithblock2:(void (^)(mtlistpagingmodel<t> *data ))block;  @end; 

the interface compile without problem.

then in class use it

@interface mttestviewcontroller : mtbaselistviewcontroller <mttestmodel *> @end  @implementation mttestviewcontroller  - (void )requestwithblock1:(void (^)(mttestmodel *data ))block { }  - (void )requestwithblock2:(void (^)(mtlistpagingmodel<mttestmodel *> *data ))block { }  @end 

both methods complaint "conflicting parameter types in implementation ...."

i see enumerateobjectsusingblock method in nsarray<objecttype> (nsextendedarray ) support type infer inside block. think should problem didn't declare type in right way?


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -