ios - Forward class as super class -


I'm trying to make a static library, which makes use of the Air Force I .a and .h I want to distribute the files along with the library.

However, one of my classes within the library is a subclass of AFHTTpsessionManager . So my previous .h file looked like this:

  #import & lt; Foundation / Foundation. H & gt; #import "AFNetworking.h" @ Interface Myclass: FTTPS Manager + (McCullus *) shared person; - (zero) doMagic; @end   

When I compiled the library and in a new examination project If A and imported .ac files I received an error "lexical or Preprocessor points 'AFNetworking.h' file not found" thought that the solution to use the forward class declaration and #import was " AFNetworking.h "like this M file has to be moved in:

  #import & lt; Foundation / Foundation.h & gt; @ Class AFHTTpsessionManager; @ Interface Myclass: FHTption Manager + (Michaels *) shared person; - (zero) doMagic; Unfortunately, this approach to understand an error throws the  "announced the next class 'use Afactiteepissn manager' to 'Maiklas' as superclass" for  As far as I further class Ask you to use it,  "O Compiler class XXX exists, but you can not see its methods and qualities"  Therefore, I'm not sure that this is a solution to my problem.  

Any suggestions on how to subclass from one class But not import it?

Can not create a class sub class whose title is unavailable. The best you can, your subclass of F HT Tipsn Manager private and instead expose a class (subclass of Anosbijeks), which serves as a mask, forwards messages to your private classes is.

You can also use a protocol as the interface for your class and can expose a method which id & lt; MyClassProtocol & gt; returns. Something like this:

  @protocol MyClassProtocol - (zero) doMagic; @ AD ID & lt; MyClassProtocol & gt; GetSharedInstance ();   

And then there is a class like this that is not coming from your library:

  @interface MyClass & lt; MyClassProtocol & gt;: AFHTTPSessionManager // ... @ end   

you can return can Instaij and GetSharedInstance.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -