Shared data format between iOS and Mac OS - ios

This is mainly a question about architecture and I do apologize if it's inappropriate for SO. I'm building a Mac OS application that is meant for creating content and the iOS application is meant for consuming the content. I am unsure about what data format to use and if I need to convert it to binary format. I know I can use iTunes to share files but I am wondering if anyone has done anything similar?

You can use whatever format you want: iTunes simply copies files and directories. Core Data is available on both iOS and Mac OS, as is SQLite.

I would create a document based application using CoreData. This way you get a lot of features for free (file saving/loading, undo, etc). A bit of a steep learning curve if you are coming from iOS, but it's worth it. Right now this template is only on the Mac, but if you are a registered developer, you can go look up a feature that they are adding in the fall that will help you. (I don't want the NDA police on SO complaining).

Related

Is it possible to use Core Data in a document-based application?

I'm working on an iOS app that will need to save data onto files. I chose to go for a Document Based app, precisely an app based on a UIDocumentBrowserViewController so that I can easily save and load files from the system's Files app.
Since the data I need to save/load on a file is quite complex: big hierarchy of different objects, with meta-data, image files, etc. I'm wondering what is the best technology to use going forward.
I came across NSFileWrapperand its ability to save different files as one. And I could definitely use that. But I also saw UIManagedDocument and the ability to use Core Data in my project while maybe saving the content of the Core Data database (I know it's not quite a database, but you know what I mean) into a file that I could write somewhere in the File App.
Is this a behavior I can expect?
To reformulate: I'm wondering if I can read/write files through a UIDocumentBrowserViewController, with data described by a UIManagedDocument that works with Core Data.
Thank you in advance. 🙂
As you have discovered, UIManagedDocument is there for your kind of application. And it does feature methods to write and read additional content like the metadata or image files you have, within the document package.
That being said, I have never used UIManagedDocument, and have never seen it used by others. A quick search of GitHub finds only this one project with two contributors who wrote a wrapper around it in 2013. Also, there does not seem to be any sample code from Apple, and the remark in the the writeAdditionalContent(_:to:originalContentsURL:) documentation that Additional content is not supported on iCloud leaves me a little concerned, but maybe it's a good sign that the Core Data team knows where to draw the line.
I have used the macOS counterpart of UIManagedDocument, NSPersistentDocument. It is in a similar situation of not being used very much, but with many more known technical issues. So a few years ago I switched to BSManagedDocument, which purportedly mimics UIManagedDocument to support Core Data in all its modern glory. I have been happy with BSManagedDocument.
In summary, if I was in your situation, yes I would give UIManagedDocument a try. But don't be surprised if you need to use a DTS support incident or two during your development.

Xcode / IOS Code visibility

How easy can it be for people to see the code / inner working mechanics of a published iOS app?
E.g if there was a certain algorithm or function/class, how easily could people be able to read that?
If it’s possible, is there any way to camouflage or encrypt it so the code can’t be read?
Cheers
A certain algorithm or function/class is not going to be visible to anyone just from having access to a published app. The apps executable has been compiled and optimised so the original source does not even exist inside it. The executables are also encrypted and while can be decrypted if you jail brake a device even then you won't get much info.
While a lot of information about how an app works can be deduced by examining how it works individual algorithms is not something to worry about.
Plus what makes you think anyone is even going to bother trying for your app.
EDIT
As there was some confusion here is a link which talks about the binaries being encrypted when producing universal and thinned ipa files:
https://developer.apple.com/library/content/qa/qa1795/_index.html#//apple_ref/doc/uid/DTS40014195-CH1-APP_STORE_CONSIDERATIONS

Is it possible to recover an iOS app from my iPhone?

I was halfway through developing an iOS app but have sadly lost the development files (it's a long story). I have the latest version still on my iPhone. Is there some way of recovering it or even just part of it for use in Xcode?
Thanks.
In theory you can decompile the binary, which should be backed up in your iTunes backup. It is not a simple process, and if you encrypted the binary you should maybe just give up. The result of the decompilation will be nothing like what you started with -- rather it will be a bunch of cryptic C functions that don't necessarily make sense but which will compile back to your app. You might get something usable. Assuming that you actually are able to decompile and rebuild your app, the challenge you will face is in the future -- maintaining/updating cryptic code.
So my advice is to check the possibility of local backups/checkins (as per other answers here). You might try undeleting the files from your hard drive (DON'T save any more files to your disk, just download undelete software and try it). Short of those things, you can take to heart the advice of my Comp Sci 101 professor. I quote:
Don't fret - it's always easier the second time around.
Good luck.
If you have Time machine enabled on your mac you may want to look in there. But other than that I don't think so.

Lua in iOS and side-loading scripts

The latest game by Gameloft called Order&Chaos starts with a Checking for Update screen, which indicates that they're able to update certain data without updating the entire binary.
I'm quite certain that they're using some kind of scripting language like Lua in their app and updating these scripts to e.g. change certain values (like buying price of items).
What's your experience with side-loading or updating scripts in your iOS application?
I don't mean loading new graphics or other contents, but game logic like my path finding implementation in Lua.
Apple cleary states that this isn't allowed
3.3.2 An Application may not download or install executable code.
Interpreted code may only be used in
an Application if all scripts, code
and interpreters are packaged in the
Application and not downloaded. The
only exception to the foregoing is
scripts and code downloaded and run by
Apple's built-in WebKit framework.
This happens in most of these applications TinyChef, RestaurantStory, HotelStory, etc..
They update content, but not the core program. Just adds new content or modifies the existing using external files and DB updates from a remote server.
Example, what they do is download new graphics and add a new item to their Desserts table of their DB and finally when they show all their Desserts the new one shows up and its ready to be cooked as if it was in the app from the beginning.
I could elaborate more info if you need.
UPDATE
If you are using lua, you could easily add, say new levels to your games, just by downloading a file containing your level data. Im sure that you are familiar with using external files one per level/item/character with a common format you then parse in your app.
You can have your path finding algorithm in another file as i said, and update (download and replace) that unique file whenever you improve it.
I haven't tried this, yet, but wouldn't it be as easy as querying a server, getting back a string, then parsing that into the database?
That might not violate Apples policy, since it wouldn't be executable code, just delimited text.
You could probably do more complicated stuff that way too. It wouldn't be a whole lot different than DropBox downloading files to your phone so you can view them. But instead of a document file, it would be a 3D object.
I think 3.3.2 clausule is to prevent that anyone can download/buy from appStore an engine like Love2D for iPhone, create games/apps in Lua, download it on the iPhone via web and execute with this engine, because it means develop and deploy apps on iPhone using an intermediate SDK instead of the official SDK, and of course, without paying anything to Apple.
Think about it, you can create your own App Store with this system and that is what Apple wants to prevent. but i think Apple doesn't take care of this type of downloads, where you want to update your own apps logic or levels.

OneNote like web clipping software for notes, code examples, and articles on Mac OS?

As a developer I find I am gathering more and more information from blogs and other resources from the web. Whether it be tips on configuring Drupal on IIS7 or tips on using the Entity Framework I find I am looking for a way to capture and organize content from the web. I also would like to be able to edit and annotate content to be able to add my own notes and remove add banners or any other content not related to what I am capturing.
When I used Windows OneNote seemed to fit the bill but I have recently moved to Mac OS and I am looking for an equivalent software package. I could run OneNote in a VM but would prefer to have a Mac OS native app. Here are some of the things I am looking for ..
Native app rather than web based. Because a web based product could go out of business and my collection could be lost.
Ability to organize and handle a large amount of data.
Good web clipping ability. So much of my content comes from the web.
Thanks for any suggestions!
I figured I would answer my own question with information on what I found. There ws no shortage of good apps on the Mac for note taking, web clips, and information storage.
Native Mac OS apps
DEVONthink (http://www.devon-technologies.com/products/devonthink/)
This is the application I decided to go with. It is expensive ($150 for Pro Office) but I really liked how it used the file system as it's storage medium and not a single database file. The fact that it has an nice iPhone and iPad app (DEVONthink 2 Go) make it my number one choice. Tagging and folder hierarchy was something I liked and really nice search capabilities. Also, built in OCR.
YoJimbo - http://www.barebones.com/products/yojimbo/
Very nice application with nice interface and nice reviews. I just didn't like how all content was saved to a single database file. Nice iPad app also.
Eagle Filer - http://c-command.com/eaglefiler/
Very similar to DEVONthink (minus the OCR) but the price was very affordable and it used the file system to store files in native format. I would have chose Eagle Filer if it had a companion iOS app.
Together - http://reinventedsoftware.com/together/
I thought Together had a really nice interface. I thought it was very similar to Yojimbo but no companion app (which YoJimbo has)
Curio - http://www.zengobi.com/products/curio/
This was an awesome (but expensive) application. In the end I found it to be more suited to creating content rather than storing it. I might look into this as a solution to brainstorming and content creation and use something like DEVONthink to store the content. Very generous trial period.
VooDooPad - http://flyingmeat.com/voodoopad/
VooDooPad got a lot of nice reviews. However, I wasn't too fond of the interface.
Circus Ponies Notebook - http://www.circusponies.com/
I personally didn't like the interface of Circus Ponies Notebook however this is a subjective thing. I did not like how a clipping service had to be created in order to import content.
Web Based Tools
Though I prefer a solution that ran as a native Mac OS app, I came across some nice web based applications.
ZoHo Notebook - http://notebook.zoho.com
Mnemonic - http://www.memonic.com/home
SpringPad - http://springpadit.com/home
Evernote - http://www.evernote.com
UberNote - http://www.ubernote.com/webnote/pages/default.aspx
MediaWiki - http://www.mediawiki.org/wiki/MediaWiki

Resources