You may have initialized another Thread inside your function buttonRestNameTag. Check that thing.
Or Try to use this function :
[self performSelectorOnMainThread:@selector(functionName) withObject:nil waitUntilDone:YES];
Hope this helps.
Edit for Kiron :
Make a variable in class and put returned value in that and access that variable.
This is helpful link to do this