You should store the data via a persistent mechanism after downloading the data, so you don't have to keep it all in memory.
Core data is one option.
If you save them to core data, then all your other issues already have well known and well used patterns (e.g., letting
NSFetchedResultsController bridge between your data and your table view).
the problem is I can't manage to download all the data. I fetch the first 1000 rows, but then I can't fetch more rows. I made the for loop in - (PFQuery *)queryForTable, but no results. Please quide me how to implement it so i can get more than 1000 rows from parse. – Lalu
Having never used parse, I don't know. However, seeing as it is a network API, and they do have a fetch limit, I can't imagine that they encourage blasting N queries at the same time in a for-loop.
I would think that you should kick off one query, and then when that one has finished, start another one where the previous one left off until you have all the objects you need.
Interested in seeing how difficult it is to discover how to do this, I entered a simple google search for "parse.com query more than 1000" which results in a page full of answers for this exact question, and quickly landed me on a forum discussion entitled "Paging through more than 10,000 results." where there is an example that verifies what I said above.
I cannot imagine why you want to download 25k objects at once, to display it in a table view. Who should look at this huge table?
But if you really want to download 25k objects from Parse, you had to issue 25 queries, 1000 objects each. And the i-th query (starting with i = 0) had to be constrained by a
query.skip = i*1000; see here.
More Answer related to the Same Query
- LOAD FROM PARSE 25K ROWS IN ARRAY AND SHOW IN TABLE VIEW IN IOS
- FILTERING DUPLICATES IN ARRAY AND DELETING ARRAY ELEMENTS FROM ANOTHER ARRAY IN SWIFT 2.0 IN IOS
- CONVERT BYTE ARRAY CODE FROM C TO SWIFT IN IOS
- SORTING JSON RESPONSE BEFORE SHOW IN TABLE VIEW CONTROLLER - OBJECTIVE C IN IOS
- GROUPED UITABLEVIEW FROM ARRAY OF OBJECTS IN IOS
- SWIFT FUNCTION FAILING TRYING TO FETCH JSON ARRAY FROM REST SERVICE AND TRANSFORM TO SWIFT OBJECTS IN IOS
- SWIFT: RETRIEVING DATA NUMBERS FROM PARSE AND COUNTING THE AVERAGE VALUE IN IOS
You can set a variable i in a loop starting from zero and increment by 1 each time and use query.skip(i*1000) but that loop will also run upto 10000 only as you can't skip more than 10000 rows. Beyond that, you will have to set the skip to zero and add a constraint that for updatedAt and select only the old rows.
Credit Goes to: stackoverflow.com
Related question with same questions but different answers
- SWIFT: PARSE COLUMN IS NOT APPENDING INTO ARRAY IN IOS
- LOOPING JSON FROM PARSE DATABASE GIVING WRONG RESULTS IN IOS
- POST DATA FROM IOS APP TO PHP WEB SERVICE (HOSTING GODADDY) IN IOS
- PLAY AVAUDIOPLAYER FILE FROM BEGINNING AFTER STOP IS CALLED IN IOS
- XCODE IAP SKPRODUCTSREQUEST START METHOD CALL DON'T SHOW EXCEPTION IN OUTPUT WINDOW IN IOS
- PASSING DATA FROM A QUERY TO MAPVIEW VIEWFORANNOTATION FUNCTION IN IOS
- NEW ARC4RANDOM()%X; DIFFERENT FROM PREVIOUS NUMBER IN IOS
- TROUBLE PASSING PARAMETER FROM UIALERTACTION IN IOS
- CONTINUOUS UPDATE VALUE OF LABLE FROM NSOBJECT CLASS IN IOS
- READING VALUE FROM CHILD SKSPRITENODE IN IOS
- APPLE WATCH FACE: CHANGE FROM AN APP RUNNING ON WATCH IN IOS
- HOW DO TRIGGER RELOADROWSATINDEXPATHS FROM A CELL? IN IOS
- HOW TO SHOW UISEARCHCONTROLLER IN SAME VIEW IN TVOS? IN IOS
- HOW CAN I ALLOW MULTIPLE USERS TO UPDATE A PARSE OBJECT? IN IOS
- RETRIEVING STRING FROM CORE DATA SWIFT IN IOS
- COLLECTIONVIEW RELOADDATA INSIDE PARSE BLOCK IN IOS
- HOW TO USE ARRAY OF ANOTHER VIEW CONTROLLER CLASS? IN IOS
- SWIFT UPDATE LABEL WITH PARSE OBJECT IN IOS
- MAPPING PARSE OBJECT DOESN'T WORK IN CALLFUNCTIONINBACKGROUND IN IOS
- UIVIEW ANIMATION IS FAR FROM SMOOTH IN IOS
- I'VE GITHUB PDF READER WORKING WITH MY SWIFT CODE WITH TEST.PDF FILE , BUT HOW TO I READ THE PDF FILES STORED AT PARSE DATABASE? IN IOS
- IN SWIFT, HOW CAN I HAVE ROWS (WITH BUTTONS ON THEM), IN A PROTOTYPE CELL, PUSH TO DIFFERENT VIEW CONTROLLERS? IN IOS
- CAN'T ACCESS APP CODE FROM XCTEST IN IOS
- ROBBIEHANSON XMPP FRAMEWORK FOR IOS NOT RECEIVING CHAT MESSAGES IN IOS
- HOW TO USE PHONEGAP-FACEBOOK-PLUGIN UNDER CLI 5.2 / PGB IN IOS
- USING STRING IN ANOTHER SWIFT CLASS IN IOS
- NEED HELP SETTING UP CUSTOM CELL IN IOS
- USE OF UNDECLARED IDENTIFIER ON A METHOD IN IOS
- LOGOUT FROM IOS APP IN IOS
- ERROR IN SPOTIFY'S IOS SDK TUTORIAL IN IOS
- PASS COOKIE TO UIWEBVIEW - IOS IN IOS
- SENDING A MESSAGE FROM MAINCONTROLLER TO DELEGATE - SWIFT IN IOS
- HOW TO RUN CODE IN BACKGROUND ? USING DISPATCH_ASYNC HOW IT WORKS? IN IOS
- IOS: CHANGE ORIENTATION OF UITABLEVIEW FROM HORIZONTAL TO VERTICAL IN IOS
- POPULATING DBMANAGER DATA INTO UITABLEVIEW IN IOS
- EASIEST WAY TO TURN NSMUTABLEDICTIONARY INTO AN NSARRAY IN IOS
- WHY XMPP FUNCTION RETURNS NOTHING? IN IOS
- SWIFT: LOCATION MANAGER NOT UPDATING LOCATION? IN IOS
- UIVIEW UNDER NAV AND TAB BARS IN IOS
- FIX THE ASPECT RATIO OF THE FIRST ROW IN UITABLEVIEW IN IOS
- ARRAYS FOR SWIFT2 IN IOS
- HOW TO 'PIN' OBJECTS IN XCODE 7.1 IN IOS
- HOW DO I REMOVE OBJECTS IN AN ORDERED TO-MANY COREDATA RELATIONSHIP IN SOME GENERIC WAY? IN IOS
- STARTDATE, ENDDATE, AND ADDING TEXT TO LABEL IN VIEWCONTROLLER IN IOS
- CKMODIFYRECORDSOPERATION NOT DELETING RECORDS IN IOS
- ANIMATION OF MULTIPLY BLENDING OF TWO IMAGES IN IOS
- OPENGL ES TO METAL - PERFORMANCE BOTTLENECK DIFFERENCES IN IOS
- UITABLEVIEWCELL - CAN'T GET UIBUTTON SUBVIEW TO OVERLAP (AND BE TAPPABLE IN) NEXT CELL IN IOS 9 IN IOS
- HOW TO FIX THIS TRY/GUARD ERROR IN SWIFT IN IOS
- UINAVIGATIONBAR DOES NOT EXTEND BEHIND STATUS BAR IN IOS
- COMPILEXIB COM.APPLE.INTERFACEBUILDER ERROR 2001 OPERATION COULDN’T BE COMPLETED IN IOS
- UIALERTCONTROLLER WITH UIPICKERVIEW IN SWIFT IOS? IN IOS