No NSPredicate on iPhone, How do I filter an NSMutable Array?

So I have an Array (NSMutable) of objects and I am trying to filter them by date. Specifically I only want those objects that are less than 7 days old.
Last night I toiled away and got NSPredicate to do the job. And it did a BEAUTIFUL Job in the simulator. So I hook up my iPod touch and click Build and Go. Error, NSPredicate, bla bla bla. hmmmmm......So I start searching online and apparently NSPredicate is available in the simulator, but does NOT work on the actual Device. It is not included as part of the Foundation. Great.
So now I'm stuck, I don't know how else to do it. The Documentation specifically tells you to use NSPredicate to filter an Array. And that's the only suggestion that it gives you. (In hindsight, it also says that it's not available on the phone. lol)
*Here is my code:*
*NSDate *nowDate = [NSDate date];*
// Take the Current date and find the time since 1970
*NSTimeInterval now = [nowDate timeIntervalSince1970];*
// Take the time since 1970 and subtract the number of seconds in a week.
*NSTimeInterval weekAgo = (now - 604800);*
// Create the Predicate to do the Filtering.
*NSPredicate *predicate = [NSPredicate predicateWithFormat:@"startDateTime >= %@", [NSDate dateWithTimeIntervalSince1970: weekAgo]];*
// Load a New array with all of the sessions.
*NSMutableArray *filteredArray = [[NSMutableArray alloc] initWithArray:[appDelegate sessions]];*
// Fiter that new Array.
*[filteredArray filterUsingPredicate:predicate]; *
+*Are there any suggestions?*+
Sorry about the weird formatting, it's my first post.

Can anyone from Apple answer this question?  I want to sell my ipod touch but it shows up as "This device is no longer eligible for creating a free iCloud account".  What do I do?  Can I go to the Apple store and request that they delet all accounts associated with the ipod?  Is that possible?  Help!!! Really frustrated at Apple right now.

Similar Messages

  • How do you filter an email search (ie: Subject or From) in iOS 7?

    How do you filter an email search (ie: Subject or From) in iOS 7?

    Hello dh1316
    The way iOS 7 searches email has changed. I have made an excerpt of the new way search works.
    iPhone User Guide
    http://manuals.info.apple.com/MANUALS/1000/MA1565/en_US/iphone_user_guide.pdf
    Search for a message. Scroll to or tap the top of the messages list to reveal the search field. You can search the current mailbox, or all mailboxes at once. Searching looks at the address fields, the subject, and the message body.
    Search by timeframe. Scroll to or tap the top of the messages list to reveal the search field, then type something like “February meeting” to find all messages from February with word “meeting.”
    Search by message state. To find all flagged, unread messages from people in your VIP list, type “flag unread vip.” You can also search for other message attributes, such as “attachment.”
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • How can I filter a Sharepoint 2007 libarry list based on current user login?

    Hi all.
    I would like to know how I can filter a SharePoint library list based on current user login.
    Suppose I have created the followings:
    1) A SharePoint form library containing bunch of uploaded InfoPath form data.
    2) The InfoPath form template contains a promoted text field called "TargetUser" to store user domain login (ex: DOMAIN\JOE) and every InfoPath form file in the library has a valid domain name stored in the "TargetUser" field.
    I have created a custom view for the form library and would like to filter this view so only items whose "TargetUser" field matches current user's login ID are displayed.
    I went to Edit View page to customize the view and tried to use the [Me] function but I got a "Filter value is not a valid text string" message instead when clicking OK. Apparently [Me] returns a Person/Group data type and the filter cannot compare its value
    to that of "TargetUser".
    I tried using text functions (ex: TEXT([Me],"") hoping to extract default string value from [Me]. The filter accepts the parameter without any error but the resulting fitlered list does not display any items at all.
    I have googled this subject for hours but I have not found any solution.
    It would be greatly appreciated if anyone can help me to create a functional filtered list.
    FYI, my SharePoint 2007 installation is just WSS 3.0 + Form Server. I do not have MOSS 2007 (so no MOSS 2007 web parts or web services).
    Thank you.
    Jason

    Here's what I usually do in order to accomplish this.  Ultimately you'll need to have 2 different fields.  There's the one you already have, with DOMAIN\username stored in it.  Then you'll need an additional field as a "person" column type. 
    Call it "TargetPerson" or something.
    Create a sharepoint designer workflow that runs each time an item is created or changed.  One action:
    Set FIELD to VALUE.
    The first FIELD is "TargetPerson", the VALUE is your "TargetUser" field. 
    Once this is done, then the person value is stored in the person field.  This is the field that you can filter by "TargetPerson" is equal to [Me]
    Laura Rogers, MCSE, MCTS
    SharePoint911: SharePoint Consulting
    Blog: http://www.sharepoint911.com/blogs/laura
    Twitter: WonderLaura

  • I updated my iphone 4 and now i have no music on iphone, how do i transfer music from itunes to my iphone?

    i update iphone 4 and now i have no music on my iphone, how do i tranfer music from itunes to my iphone?

    Connect to iTunes via USB cable and reselect your music you want to sync.

  • I backup my iphone on my pc and copy backup file into drive D then i setup new OS on my pc. after that i copy the backup file into itunes backup folder but itunes can't find the backup file to restore my iphone. how can i restore my iphone?

    i backup my iphone on my pc and copy backup file into drive D then i setup new OS on my pc. after that i copy the backup file into itunes backup folder but itunes can't find the backup file to restore my iphone. how can i restore my iphone?

    Don't you just love changes in interfaces?
    I found the answer to my question.
    When you attach a device (iPhone, iPad) to your Mac, in iTunes 12 in appears as a tiny icon in the second "row" of the iTunes display. Click the icon and the familiar iTunes display for the device appears. From there, on the Summary screen, you can see the dates of the backups of the device (iCloud and backup to the computer). You can also use the button to backup to the computer.

  • HT1848 when i purchase ringtones and they download directly to the music app on iphone, how can I move them to SOUNDS in SETTINGS so I can assign to various functions please?

    when i purchase ringtones and they download directly to the music app on iphone, how can I move them to SOUNDS in SETTINGS so I can assign to various functions please?

    You would have to create the ringtones.
    Google will find several way to do this.
    You cannot buy ready made ringtones from your computer.

  • I HAVE AN OLD 3G IPHONE , HOW DO I USE IT IN ANOTHER COUNTRY WITH A NEW SIM CARD

    I  HAVE AN OLD 3G IPHONE , HOW DO I USE IT IN ANOTHER COUNTRY WITH A NEW SIM CARD ?

    it has to be unlocked by your carrier. give them a call

  • I have just switched to samsung and i have removed the sim from the iphone however i am still receiving texts rather 'imessage' on the old iphone. how do i make sure all messages only come to my new phone??

    i have just switched to samsung and i have removed the sim from the iphone however i am still receiving texts rather 'imessage' on the old iphone. how do i make sure all messages only come to my new phone??

    You can turn iMessage off on your iPhone.  That's relatively easy.  Since iMessage is an Apple product/service, I have no idea how a Samsung phone will deal with an incoming one.  For that answer you should probably contact Samsung support.

  • HT4236 If I want to delete the photo library from my iPhone, how do I make sure I dont delete them from my desktop as well?

    If I want to delete the photo library from my iPhone, how do I make sure I dont delete them from my desktop as well?

    If you have copied them to your computer, then you will be OK.  Just deselect the photos when you sync.

  • I have different apple ids for my ipad and iphone - how do i sync so that the apps appear on both devices, e.g errands

    I have different apple ids for my ipad and iphone - how do i sync so that the apps appear on both devices, e.g errands

    If both accounts are authorised on the computer's iTunes that you sync them to, and the relevant apps are on that computer, then you should be able to sync them to both devices. The apps will be tied to the account that originally bought/downloaded them, so only that account will be able to download updates to them.
    If you log into the other account on a device and re-download its apps onto them then you risk tying the device to that account for 90 days (and similarly redownloading on a computer's iTunes) : http://support.apple.com/kb/HT4627

  • I uploaded a video from itunes to my iphone how can i send it to my friend?

    I uploaded a video from itunes to my iphone how can i send it to my friend

    You can't. The techical term for that is "stealing".

  • I have lost my iphone, how can i get the IMEI number?

    i have lost my iphone, how can i get the IMEI number?

    If you need the IMEI for an insurance or police report:
    how to find IMEI, etc
    http://support.apple.com/kb/HT4061?viewlocale=en_US&locale=en_US
    But as Carolyn Samit said above, you cannot track the iPhone by IMEI.

  • Somebody uses my apple id for facetime on his iphone how can i remove his phone from my account?

    somebody uses my apple id for facetime on his iphone how can i remove his phone from my account?

    Last Spring I received a couple of emails to an alias I set up a long time ago under mac mail with mac.com - not my main ID - at mac.com.   The mail had the Icloud extension.     I just deleted it.
    I then received a couple of e-mails forwarded to the same alias that came from a non-apple account that led me to search to see if the company was legit - it was.     Using a non-apple hidden account I sent that non-apple account an email informing them apparently when they registered the ID or alias as an ICLOUD extension - apple did not check for duplication in accounts or aliases that were not in the Icloud.
    I also sent feedback to Apple telling them to fix it and apparently they did - along with the person who replicated my alias.
    On this site there were a number of postings from people who also had problems with mac mail and Icloud who resolved it by contacting Apple and getting the accounts cleared up.

  • HT201210 my friend connected my iphone to his laptop and now his apple ID is on my iphone- how do I change it back to my apple ID on my phone so that I can purchase from itunes again?

    my friend connected my iphone to his laptop and now his apple ID is on my iphone- how do I change it back to my apple ID on my phone so that I can purchase from itunes again?
    thanks.

    Restore your phone using the last backup that you made. That should put everything back the way it was.

  • Device is no longer eligible for creating a free icloud account how to create on iphone, How do I create an apple ID if it says " No longer eligible for creating a free iCloud account "? It says Account limit reached?

    device is no longer eligible for creating a free icloud account how to create on iphone, How do I create an apple ID if it says " No longer eligible for creating a free iCloud account "? It says Account limit reached?
    Kindly advice.
    Thanks
    Mahfooz

    I had the same issue on my iPod touch 4th Gen, I noticed the issue after updating the device to 6.1.5. I dont know what device or IOS your running but if it is similar then I think this ma be the cause. My solution to you is to create a free apple ID on their website, https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/wa/createAppleId. Hope this helped and good luck!

Maybe you are looking for

  • Java 1.4.2._03 error?

    I define an action class that extends AbstractAction. I have two constructors for this action class - one is passed a name string and an icon and the other is simplely passed a name. All I do in the contructor is call either super(string, icon) or su

  • XML-Type and reference to unavailable DTD causes validation problems

    Hi, I'm fairly new to Oracle's XML features. I've created a view that produces XML from a number of tables. The resulting XML is used to be stored on a web site for download by customers (this is a manual process about once a week via a CMS). It cont

  • Attempting to copy to disk failed.

    I was using my iPod in cold weather the other night. The battery died and when it warmed back up the screen was in grayscale and it was in "disk mode". I have since restored it several times and am trying to sync it with iTunes. I keep getting an err

  • More than 50 char email subject to SAP inbox

    Hi Guys, I have the ff email reqt in my workflow: 1. Subject with more than 50 char 2. Message URL with more than 80 char 3. Message text in bold I cannot address all 3 when using send mail step so I created an activity step instead and call my metho

  • Covering all possibilities

    How would i go about making all possible strings of n 1's and n 0's where there are never more 0's than 1's in the string?