nickkjordan / wruw-iphone-app

iPhone app for WRUW 91.1 Cleveland, OH http://www.wruw.org/
1 stars 2 forks source link

Ability to UnFavorite a Song #11

Closed nickkjordan closed 10 years ago

nickkjordan commented 10 years ago

Ability to unfavorite a song in the Favorites TVC

nickkjordan commented 10 years ago

tried to use removeObjectIdenticalTo: but this requires that the two objects being compared have the same address. Unfortunately, when archiving and unarchiving the mutable array in the documents folder, the addresses of the Favorited Songs change with every opening.

nickkjordan commented 10 years ago

Simple overview of overriding the isEqualTo method of an NSObject:

http://nshipster.com/equality/

nickkjordan commented 10 years ago

Don't use removeObjectsIdenticalTo: because it tests for the objects address. removeObject tests for equality using isEqual:

http://stackoverflow.com/a/3737028