Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It seems to me that you have SwbPlateImage local variable where you are assigning context which is not available in the for loop when you are checking for context. You will need to have Singleton class(say SwbPlateImageSingleTon) that manages and stores SwbPlateImage's context objects. I can help you writing singleton class if you can give some more details about the classes you mentioned in the question.</p> <p>From your question, it looks like, you will need to have NSMutableArray(say contextArray) of CGContextRef as a strong object in the singleton class. Rather than assigning context to image.imageContext, add context into this array. </p> <pre><code> [[SwbPlateImageSingleTon sharedInstance] contextArray] addObject:context] </code></pre> <p>Then your inner loop will look like below.</p> <pre><code> for (CGContextRef context in [[SwbPlateImageSingleTon sharedInstance] contextArray]) { if(CGContextPathContainsPoint(context, [touch locationInView:self.view],kCGPathFillStroke)) { NSLog(@" We Touched within the IMAGE"); } } </code></pre> <p>Singleton class</p> <p>SwbPlateImageSingleTon.h</p> <pre><code>@interface SwbPlateImageSingleTon : NSObject @property (strong, nonatomic) NSMutableArray *contextArray; + (SwbPlateImageSingleTon*)sharedInstance; @end </code></pre> <p>SwbPlateImageSingleTon.m</p> <pre><code>#import "SwbPlateImageSingleTon.h" @implementation SwbPlateImageSingleTon static SwbPlateImageSingleTon *sharedObject = nil; + (SwbPlateImageSingleTon*)sharedInstance { @synchronized(self) { if (!sharedObject) { sharedObject = [[SwbPlateImageSingleTon alloc] init]; } return sharedObject; } } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload