I am dynamically building an FQL query statement and because of the nature of the app, I exclude FB family members, this is the base portion of the query and remains fairly static. The query returns the FB profile pic and I display it on the UI.

However, after the FB friends are displayed on the UI, I want to give the user the option to select a returned FB friend to never be returned in future queries and to return a new user in that users place

Currently I am storing the other returned member uid's as a temporary exclusion in a Mutable Array, to prevent duplicate members being on the screen at once, I am also storing the excluded member in a different mutable array.

I then build the query statement dynamically inserting the exclusion of all of the uids in the temp array and in the excluded array and then I dump the temp array after I return a new user in the place of who they picked to exclude.


What are some recommendations on the following:

  1. storing these excluded uids(strings) during the apps lifetime? resort to a persistent storage method(core data/sqlite) or store in an array that is a part of a user object (NSUSer Defaults seems like a bad choice as this list can potentially be very long)

  2. What are recommendations on some persistent storage so that exclusions can be taken into a query statement after the app is shutdown and started up (core data/sqlite/nsuserdefaults seem to be the only options here, userdefaults seems to be the least favorable because the reason mentioned above)

  3. What are recommendations on injecting these unknown amount of uids(strings) into an FQL query statement which will be a string itself?

1 Answer 1


Best will be to store all your FQL objects to Core Data and filter them with some property, like this.

 typedef enum {
     kFamily = 0,
     kActiveFriend = 1,
     kNonActiveFriend = -1
    } TypeCheck;

    @interface CoreDataFQLObject : NSManagedObject
    @property (nonatomic, retain) NSNumber *checkType;

A hint enum is a integer in Core Data. You need to prevent non friend user to appear on new log in account. For that you can delete .sqlite file and recreate again when user is try to login with another account credential. Or you can make a Core Data scheme with one to many rule for user who was just logged in "me()". Do not forget to check for duplication on insert operation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.