Data structure design and storing

I'm creating a app that lets the user choose from several "designs".

The app lets the user take a photo and add text etc...

The "design" will incorporate an image, an area to place the text, the font, the colour of the text, possibly a combination of CIFilters etc...

There is also potential to purchase more designs through an IAP.

I really have no idea how to go about storing and using this data in the app. And especially how to make it easy to download from Apple "hosted content" if that's even possible.

At the very least I'll need something like...

Design Name Small Image (thumbnail) Large Image Text Font Text Colour Text Background Colour Text Label Rect Origin (width and height can be inferred)

Possibly also...

Filter info (not sure how to do this? Maybe an NSDictionary with "Name" and "keys/values").

The filter info could be used with + (CIFilter)filterWithName:keysAndValues: .

I'm really stuck on how to design and implement this.

There will only be 6 "designs" to begin with and the maximum number will only go to something like 15 or 20.

I have used Core Data a lot in the past but I'm not certain it is right for this. It seems overly complex and heavy-weight for this.

Could I use the file store on the device to store the information? I haven't really done this before so I'm not sure of whats possible.


If you want to use Apple's hosted IAP bundles there are some rules:

  • iOS6 only
  • Cannot include any executable code in the bundle
  • You have to create bundles in Xcode
  • Images, Txt, PLIST and other static content are all ok inside a bundle
  • When building / testing you can use Folders instead of bundles. Every folder would contain any settings for working with its own content (text file or plist), images it will use.

    You still need to manage the list of IAPs your app will use yourself and find a way to reference those against your potential available IAP bundles.

    Get the app working with a "theme" pack structure based on folders first and you'll be able to transfer over to Apple hosted content quite easily.

    This tutorial from Ray Wenderlich is a great start: http://www.raywenderlich.com/21081/introduction-to-in-app-purchases-in-ios-6-tutorial

    But the best information is in the full iOS 6 by Tutorials.

    For my app (Words Inside) I didn't use Apple's hosted content because I wanted iOS5 support but I did bundle each IAPs content into the right structure to do so in the future.

    I recommend managing your IAP activations through the Keychain on iOS. That way nobody can tamper with your IAPs later. They even survive an app delete / reinstall. Consumables do too, surprisingly. During testing I had a button which could delete the keychain data for my app so that I could test the IAPs using the sandbox system and then remove them again.

    For managing the IAPs themselves I used MKStoreKit (https://github.com/MugunthKumar/MKStoreKit). It's quite good but there are quite a few bugs in it and it also leaks memory. I ended up simplifying it and modifying it for my needs.

    IAPs add a lot of complexity to an app. Obviously that's the "trend" right now. Not sure I like it but I had to try it.

    Best of luck with your app. :)

    链接地址: http://www.djcxy.com/p/68754.html

    上一篇: 软件链来查找重复的图像

    下一篇: 数据结构设计和存储