Monday, 11 May 2015

Best way to compare two NSDictionary


i thought ask before start write out code compare 2 nsdictonaries. wanted see if there class make easier , faster.

have 2 plists
• allclientsplist
• selectedclientplist

user selects client tableview , extracts current client allclientplist , saves selectedclientplist work instead of entire list of clients.

pushes new view on stack. in new view user can make changes phone numbers , on. when user presses button return previous viewcontroller writes changes, if any, selectedclientplist.

in first viewcontroller again want compare selectedclientplist against on stored in index of allclientplist see if identical. if not want replace information client in allclientsplist.

going load client both plists in 2 nsdictonary , compare key/value pairs nsstrings.

thought there might created take advantage of me, don't know yet?

thought check first.

 

how compare 2 objects equality?

use isequal: method. (look in nsobject.)

method in nsdictionary's class reference doc, , see says.

or make test program, try it, , see happens.
 


Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment