I have method which builds NSString and returns it correctly. However if i call the same method from separate thread it returns nil even though my NSString is not nil in line with return.
I get request = nil in "getPhones" method.
"return request" in "createSelectPhonesRequest" ontains valid string.
"getXmlRow" actually builds the string.
+ (void)getUserPhones:(User *)user
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    [DataManager getPhones:user];
    [pool release];
}
+ (void)getPhones:(User*)user
{
    NSString *request = [XMLBuilder createSelectPhonesRequest:user.NickName];
    NSString *getAddressesResponce = [TrafficManager sendRequest:request];      
}
+(NSString*) createSelectPhonesRequest:(NSString*)nickName
{
    NSString *request;
    NSMutableArray *attributes;
    NSMutableArray *attributesValues;
    /*** root ***/
    attributes = [NSMutableArray new];
    attributesValues = [NSMutableArray new];
    //time
    [attributes addObject:xmlAt.time];
    [attributesValues addObject:[NSDate getXmlFormattedDateFromCurrentDate]];
    //action
    [attributes addObject:xmlAt.action];    
    [attributesValues addObject:xmlAV.selectPhones];
    request = [XMLBuilder getXmlRow:xmlEl.envelop 
                         attributes:attributes 
                   attributesValues:attributesValues 
                              value:nil 
                              close:YES];
    [attributes release];
    [attributesValues release];
    return request;
}
+(NSString*) getXmlRow:(NSString*)element 
               attributes:(NSMutableArray*)attributes 
         attributesValues:(NSMutableArray*)attributesValues 
                    value:(NSString*)value 
                    close:(BOOL)close
{
    //open tag
    NSString* xmlRow = @"<";    
    //tag
    xmlRow = [xmlRow stringByAppendingString:element];
    //attrivutes+values
    if (attributes && attributesValues)
        for (int i=0; i<[attributes count]; i++)
        {
            NSString *attribute = (NSString*) [attributes objectAtIndex:i];
            NSString *attributeValue = (NSString*) [attributesValues objectAtIndex:i];
            xmlRow = [xmlRow stringByAppendingString:@" "];
            xmlRow = [xmlRow stringByAppendingString:(attribute)];      
            xmlRow = [xmlRow stringByAppendingString:@"=\""];
            xmlRow = [xmlRow stringByAppendingString:attributeValue];       
            xmlRow = [xmlRow stringByAppendingString:@"\""];
        }
    //end tag
    xmlRow = [xmlRow stringByAppendingString:@">"];
    //value
    if (value != nil)
        xmlRow = [xmlRow stringByAppendingString:value];
    //close tag
    if (close)
        xmlRow = [xmlRow stringByAppendingString:[self closeElement:element]];
    return xmlRow;
}
 
     
    