How to wrap to a detailForGraphic string

629
1
05-16-2012 12:27 AM
benchen
New Contributor
//details for the callout
- (NSString *)detailForGraphic(AGSGraphic *)graphic screenPoint(CGPoint)screen mapPoint(AGSPoint *)map {
    //return [NSString stringWithFormat:@"'90: %@, '99: %@", [graphic.attributes valueForKey:@"POP1990"], [graphic.attributes valueForKey:@"POP1999"]];
    NSString *str= [NSString stringWithFormat:@"class:%@\n govement:%@\n",[graphic.attributes valueForKey:@"XL"],[graphic.attributes valueForKey:@"XZQMC"]];
    NSLog(str);
    return str;
}

I hope that result such as "class:XXXX
                                         govement: XXX" this is also (NSString)str`s results.
but the result is "
class:XXXX   govement: XXX", there is no line feed.
How can i do ?

                        
0 Kudos
1 Reply
NimeshJarecha
Esri Regular Contributor
Just replace \n with \r and it should work!

Regards,
Nimesh
0 Kudos