[lldb] Add missing operations to GetOpcodeDataSize (#120163)
[llvm-project.git] / clang-tools-extra / docs / clang-tidy / checks / objc / avoid-nserror-init.rst
blob4de389bdd35056739d4951a96a2e367bd6ce9a2d
1 .. title:: clang-tidy - objc-avoid-nserror-init
3 objc-avoid-nserror-init
4 =======================
6 Finds improper initialization of ``NSError`` objects.
8 According to Apple developer document, we should always use factory method
9 ``errorWithDomain:code:userInfo:`` to create new NSError objects instead
10 of ``[NSError alloc] init]``. Otherwise it will lead to a warning message
11 during runtime.
13 The corresponding information about ``NSError`` creation: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ErrorHandlingCocoa/CreateCustomizeNSError/CreateCustomizeNSError.html