Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "Bcpp.h"
- #import "B.h"
- @interface B ()
- {
- Bcpp myBcpp; // declare instance c++ variable of type Bcpp
- }
- @end
- #import "Acpp.h"
- #import "A.h"
- @interface A ()
- {
- Acpp myAcpp; // declare instance c++ variable of type Acpp
- }
- @end
- @implementation A
- // method to return an instance of B from an instance of A (self)
- - (B)GetBfromA
- {
- Bcpp *bfroma = myAcpp.GetBfromA(); // return c++ object
- // How do i find the objective C++ object B from its wrapped c++ instance bfroma?
- }
- @end
- - (id)initWithBcpp:(Bcpp*)bcpp
- {
- self = [super init];
- if (self != nil)
- {
- myBcpp = *bcpp;
- }
- return self;
- }
- - (B*)GetBfromA
- {
- Bcpp *bfroma = myAcpp.GetBfromA(); // return c++ object
- B* result = [[B alloc] initWithBcpp:bfroma];
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement