0

Little explanation of the code : I have a dict that looks like this :

HC_1 : test1, HC_2: test2, ....

If I find HC_1 in the "theModifiedReportTemplateContent", I look for the first ">" after and I add "test1".

 -(NSMutableString*)almMapData:(NSDictionary *)aDictData;
{

NSMutableString *theModifiedReportTemplateContent = itsReportTemplateContent mutableCopy];

for(id theCell in aDictData)
{
    NSRange theNameRange = [theModifiedReportTemplateContent rangeOfString:theCell];
    NSString *theNewContent = [theModifiedReportTemplateContent substringFromIndex:theNameRange.location];
    if(theNameRange.location != NSNotFound)
    {
        NSRange theCharRange = [theNewContent rangeOfString:@">"];
        long theIndex =((long)theCharRange.location+(long)theNameRange.location+1);
        [theModifiedReportTemplateContent insertString:[aDictData objectForKey:theCell] atIndex:theIndex];

    }
}

return theModifiedReportTemplateContent;

}

My problem is that we I print theCharRange, I have something like :

location=13, length=1
 {
  2001-01-01 00:00:00 +0000

  <object returned empty description>

}

So I have a exception with InsertString atIndex.

Kaki
  • 33
  • 6

0 Answers0