Here is the link to the sample code http://developer.apple.com/library/ios/#samplecode/MVCNetworking/Introduction/Intro.html
Below is the code snippet from the file NetworkManager.m
+ (NetworkManager *)sharedManager
// See comment in header.
{
static NetworkManager * sNetworkManager;
// This can be called on any thread, so we synchronise. We only do this in
// the sNetworkManager case because, once sNetworkManager goes non-nil, it can
// never go nil again.
if (sNetworkManager == nil) {
@synchronized (self) {
sNetworkManager = [[NetworkManager alloc] init];
assert(sNetworkManager != nil);
}
}
return sNetworkManager;
}
Obviously there are thread safe issues here. Two NetworkManager instance may be created when there are more than one thread. So Apple made a mistake, right?