Objective C
Singletonの実装 内部変数を用いた方法で実装 static TCPState* sharedInstace = nil; + (TCPState *)sharedInstance{ if (!sharedInstace) { sharedInstace = [TCPState new]; } return sharedInstace; } ただし、シングルトンのインスタンスがnilかどうか(…
Singletonの実装 内部変数を用いた方法で実装 static TCPState* sharedInstace = nil; + (TCPState *)sharedInstance{ if (!sharedInstace) { sharedInstace = [TCPState new]; } return sharedInstace; } ただし、シングルトンのインスタンスがnilかどうか(…