core-data

Core Data and textfiles in iOS applications

随声附和 提交于 2020-01-03 21:07:30
问题 I'm creating a simple iOS application consisting of a few UITableViewControllers. The information displayed in the view controllers will come from a text file (that I'll include in the project's Resources). The text file's contents will come from a spreadsheet. Since this is my first time working with Core Data I have a few questions: What format is most common for the text file? CSV, XML or something else? What's the easiest way to import the data? A few notes: The data is static. Ideally

How to save recorded audio iOS?

。_饼干妹妹 提交于 2020-01-03 20:58:02
问题 I am developing an application in which audio is being recorded and being transcribed to text. I am using the Speechkit provided by Nuance Developers. The functions I am adding are: Save the recorded audio file to persistent memory Display the audio files in a table view Load the saved audio files later Play the audio files How do I save the audio files to persistent storage? Here's the code : https://gist.github.com/buildFlash/48d143217b721823ff4c3c03a925ba55 回答1: When you record audio with

iOS - how to handle online/offline data

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 20:55:10
问题 I am currently developing an app with a big database. Think of the app as similar to TripAdvisor in the following way: multiple cities with different databases, each between 5, 10, 20, 30 MBs. My whole app is based on this data: every view needs some part of it. I'm having big trouble finding the correct way to handle this huge chunk of data. I am currently using CoreData: I think it is a great tool, and for offline mode, it definitely works great. The problem is, I can't really combine it

coredata how to change default NSSet to NSMutableArray

▼魔方 西西 提交于 2020-01-03 20:41:32
问题 CoreData one-to-many default to generate NSSet ,how to change NSSet to NSMutableArray ?I try to change it manually,but get error: _NSFaultingMutableSet filteredArrayUsingPredicate:]: unrecognized selector sent to instance 0x1ed35e40' 回答1: NSSet has the method allObjects , which returns an NSArray . To get an NSMutableArray you could do this: NSMutableArray *array = [NSMutableArray arrayWithArray:myCoreDataObject.mySet.allObjects]; Note: order is not guaranteed to be the same every time (sets

coredata how to change default NSSet to NSMutableArray

时光毁灭记忆、已成空白 提交于 2020-01-03 20:41:16
问题 CoreData one-to-many default to generate NSSet ,how to change NSSet to NSMutableArray ?I try to change it manually,but get error: _NSFaultingMutableSet filteredArrayUsingPredicate:]: unrecognized selector sent to instance 0x1ed35e40' 回答1: NSSet has the method allObjects , which returns an NSArray . To get an NSMutableArray you could do this: NSMutableArray *array = [NSMutableArray arrayWithArray:myCoreDataObject.mySet.allObjects]; Note: order is not guaranteed to be the same every time (sets

In Xcode 6 beta 4 (iOS 8), why does Core Data not persist UIImage fields to the backend like it did in iOS 7 when I declare it Transformable?

﹥>﹥吖頭↗ 提交于 2020-01-03 18:42:27
问题 In my iOS project's data model, I have an entity called Foo that has a field image . I've always stored this field by using the Transformable setting such that iOS would automatically use NSCoding to store image. However, I found that when I try to retrieve it, the UIImage * that comes out is corrupt. It has CGSizeZero size most of the time and does not contain valid data. Has anyone also experienced this under Xcode 6 beta 4? NB: I'm using MagicalRecord to set up the Core Data stack. I have

coredata problem nsurl may not respond to stringByAppendingPathComponent

丶灬走出姿态 提交于 2020-01-03 15:58:29
问题 I had some problems after starting a new coredata project with the xcode 3.2.5... my previous projects with core data (in previous xcode) worked fine, so I dont know what is the difference?? so the error I get when I build and go to the view that calls the core data is> *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter' the strange thing is that in my *AppDelegate.m, in (edited thanks Rog but still not

Replacing Core Data sqlite file while app is running, data does not update

谁说我不能喝 提交于 2020-01-03 13:39:48
问题 I am developing a backup/restore system for my app in which the user can download a backed-up version of the core data store (sqlite file) and replace the currently-used data store with the downloaded file. However, once the user downloads the file and replaces the current data store, none of the data appears to have been updated. But when the app is quit & re-launched, the restored data is available. How can I force my app to reload the core data store's file? I have tried to access the app

Replacing Core Data sqlite file while app is running, data does not update

情到浓时终转凉″ 提交于 2020-01-03 13:38:11
问题 I am developing a backup/restore system for my app in which the user can download a backed-up version of the core data store (sqlite file) and replace the currently-used data store with the downloaded file. However, once the user downloads the file and replaces the current data store, none of the data appears to have been updated. But when the app is quit & re-launched, the restored data is available. How can I force my app to reload the core data store's file? I have tried to access the app

Core Data NSPredicate filter by entity class?

梦想与她 提交于 2020-01-03 09:12:11
问题 How would I create an NSPredicate to filter by entity of class Contact ? The solution to NSPredicate check for kind of object class crashes: [NSPredicate predicateWithFormat:@"person.class == %@", [Contact class]]; *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath person.class not found in entity <NSSQLEntity User id=12>' Background I have the Core Data entities User (app user) & Contact (address book contact), both children of Person (abstract