thieumao

Try in Swift

Mar 13th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.27 KB | None | 0 0
  1. neverdie_py: try là throw ra catch
  2. let a = try! …. => lệnh này ko throw, nếu lỗi thì crash
  3. let a = try? … => ệnh này ko throw, nếu lỗi thì trả a = nil
  4.  
  5. dùng try! try? thì bạn ko cần tạo do-catch, còn try thì phải tạo do-catch synctax
Advertisement
Add Comment
Please, Sign In to add comment