I tried to push_back number to @property std::deque, but data doesn't add to deque and it empty
Code:
.h file
@interface HandTrackingViewController : CommonViewController
@property (readwrite, nonatomic) std::deque<double> vect;
@end
.mm file
#import "HandTrackingViewController.h"
@implementation HandTrackingViewController
- (void)mediapipeGraph:(MPPGraph*)graph
didOutputPacket:(const ::mediapipe::Packet&)packet
fromStream:(const std::string&)streamName {
...
...
...
for (int handIndex = 0; handIndex < multiHandLandmarks.size(); ++handIndex) {
...
for (int i = 0; i < landmarks.landmark_size(); ++i) {
self.vect.insert(self.vect.end(), {landmarks.landmark(i).x(), landmarks.landmark(i).y(), landmarks.landmark(i).z()});
}
for(int i=0; i < self.vect.size()-2; i+=3) {
NSLog(@"(%f, %f, %f)", self.vect[i], self.vect[i+1], self.vect[i+2]); // deque is empty
}
}
}
}
@end
But if you make an intermediate deque and assign it to self.vect, then it works