मैं CGGathRip ऑब्जेक्ट में प्रत्येक CGPathElement पर फिर से शुरू करने के लिए CGPathApply का उपयोग करने की कोशिश कर रहा हूं (मुख्य रूप से CGPath डेटा को जारी रखने के लिए एक कस्टम तरीका लिखने के लिए)। समस्या यह है कि, जब भी यह CGPathApply को कॉल करने के लिए मिलता है, तो मेरा प्रोग्राम बिना किसी जानकारी के क्रैश हो जाता है। मुझे संदेह है कि समस्या एप्पल समारोह में है, लेकिन मैं नहीं बता सकता। यहां मेरे कोड का एक नमूना है:CGPathApply का सही उपयोग कैसे करें
- (IBAction) processPath:(id)sender {
NSMutableArray *pathElements = [NSMutableArray arrayWithCapacity:1];
// This contains an array of paths, drawn to this current view
CFMutableArrayRef existingPaths = displayingView.pathArray;
CFIndex pathCount = CFArrayGetCount(existingPaths);
for(int i=0; i < pathCount; i++) {
CGMutablePathRef pRef = (CGMutablePathRef) CFArrayGetValueAtIndex(existingPaths, i);
CGPathApply(pRef, pathElements, processPathElement);
}
}
void processPathElement(void* info, const CGPathElement* element) {
NSLog(@"Type: %@ || Point: %@", element->type, element->points);
}
इस विचार के लिए कोई विचार क्यों है कि इस एप्पल विधि को कॉल क्यों क्रैश हो रहा है? कोई भी मदद बहुत ही सराहनीय होगी।
http://www.mlsite.net/blog/?p=1312 –
यहां एक नज़र डालें, यह CGPathApply का सही तरीके से उपयोग करने के तरीके पर एक शानदार पोस्ट है: http://oleb.net/blog/2012/12/तक पहुँचने-सुंदर-मुद्रण-cgpath-तत्वों / –