NSArray-Addtions.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // NSArray-Addtions.h
  3. // JasonDevelop
  4. //
  5. // Created by Jason Lee on 10/29/14.
  6. // Copyright (c) jasondevelop. All rights reserved.
  7. //
  8. @import Foundation;
  9. @interface NSArray (Addtions)
  10. /**
  11. * 배열내 스트링 객체 중, 동일한 문자열을 가진 객체를 반환함.
  12. *
  13. * @param key key
  14. * @param aString string
  15. *
  16. * @return object
  17. */
  18. - (id)objectKey:(NSString *)key eqaulToString:(NSString *)aString;
  19. /**
  20. * 오브젝트 인자와 동일한 오브젝트를 찾아 리턴함.
  21. *
  22. * @param description 서브 배열 description
  23. * @param aObject 찾을 Object
  24. *
  25. * @return 동일 Object
  26. */
  27. - (id)objectInSubArrays:(NSString *)description as:(id)aObject;
  28. /**
  29. * 서브 배열에서 조건 - 필터링된 새로운 배열을 리턴함.
  30. *
  31. * @param description 서브 배열 description
  32. * @param pred 필터
  33. *
  34. * @return array
  35. */
  36. - (NSArray *)matchedArrayInSubArrays:(id)description predicate:(NSPredicate *)pred;
  37. /**
  38. * 서브 배열에서 조건 - 필터링된 새로운 배열을 리턴함.
  39. *
  40. * @param description 서브 배열 description
  41. * @param format predicate 포맷 필터
  42. *
  43. * @return array
  44. */
  45. - (NSArray *)matchedArrayInSubArrays:(id)description predicateFormat:(NSString *)format, ...;
  46. /**
  47. * 서브 배열에서 associated된 오브젝트와 조건을 매칭하여 일치하는 오브젝트를 리턴함.
  48. *
  49. * @param description 서브 배열 description
  50. * @param objectName associated object name
  51. * @param condition condition
  52. *
  53. * @return array
  54. */
  55. - (NSArray *)matchedArrayInSubArrays:(id)description objectName:(NSString *)objectName condition:(BOOL)condition;
  56. /**
  57. * 배열내의 객체에 associated된 오브젝트와 조건을 매칭하여 일치하는 오브젝트를 리턴함.
  58. *
  59. * @param objectName associated object name
  60. * @param condition condition
  61. *
  62. * @return 일치하는 오브젝트
  63. */
  64. - (id)matchedObjectName:(NSString *)objectName condition:(BOOL)condition;
  65. - (NSArray *)filteredArrayUsingPredicateFormat:(NSString *)format, ...;
  66. - (NSString *)jsonStringWithPrettyPrint:(BOOL)prettyPrint;
  67. @end