Alarm Clock Settings - objective-c

I am building an alarm app using local notifications.
I want to add settings inside my app.
So for this I have created the whole view,now I am confused how to store data for multiple alarms?
Whether i should use NSUserDefaults or sqlite.

You have all the choices:
a) Use NSUserDefaults by doing some simple Key amendments like with keys like SettingAttr = Value, e.g. "MyAlarm0Start" = 10:23:12, "MyAlarm1Start" = ... and for instance the number "MyAlarmCount" = 2
or use
b) a complete data model by CoreDate or SqlLite.
I think this strongly depends on how much data you want to store.
Concerning iTunes library am do not understand what you wanted to know.
Edit: Picking things from your media library is handled via the "Media Player Framework", see Apple Doc IPod Library Access.

Related

PHAsset - Property way to save captured PHAssets locally? (in app)

trying to understand the concept for Photos/Photos.h framework.
my goal is:
write captured video url (or asset) to app's "userDefaults".
read from "userDefaults", & fetch each saved asset data (thumbnail & url)
Since you're not providing any code (nor asking for any), I can help sort some of this out for you -- but you need to study a bit more before you can put it all together. Especially if you think you've asked a question which has one simple correct answer.
UserDefaults is not a good place to store an image. Images are big. (You should look at Apple's documentation of what UserDefaults is for/how it's intended use).
UserDefaults
There's more than one place to store images. Do you want the system to delete them if you start running out of memory? Then it belongs in cache:
let cachesPath = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).last!
Do you want to depend on it being around the next time the app is run? There is a standard place for that as well:
let userDocumentsFolder = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
Do you want iTunes to back up the images for you automatically? It expects files to be in a certain place for automatic backup. Do you have a way to keep track of where it is (the path to the file can change if the app is re-run). For that you might require persistent storage, so CoreData or Realm might be an option for you. Or you could scan your directory and create a list of files you've already saved. Then you'll need a way to select the correct one. (What did you call it? Should the user select it?)
Apple has very clearly written and useful documentation on access to the Photos library and using PHAssets. Here's just one example:
PHAsset - Photos
There are a lot of talented people on this site, and they are willing to help you, but you need to do your homework before coming here.
I recommend you read these linked documents, start writing some code, and if you run into problems please come back and ask any specific question you have about any specific problem you've encountered. Include the code which causes the problem, as well as the exact error message you are getting. We will be glad to help.

Sencha Touch LOcal Storage on Mobile Apps

I am planning to use Sencha Touch for an application of my company. I read that local storage stores data on client's browser. MY problem is when I build the code to native app using Sencha CMD how does the local storage work? What is the alternative of local storage to keep some data suppose user details (so that user doesn't need to login always).
Advance Thanks
localStorage
Is a very easy to use interface that works synchronous. It stores strings (you can JSON.stringify other Javascript objects) as key-value pairs and you just set the value with a key in this way:
localStorage.setItem('key', 'value');
To read:
var value = localStorage.getItem('key');
which returns value or null if key wasn't found in the storage.
You can use it as an object:
localStorage['key'] = 'value';
var value = localStorage['key'];
however, this is not the recommended approach. In this case undefined will be returned for non-existing items.
More details:
http://www.w3.org/TR/2013/PR-webstorage-20130409/
http://diveintohtml5.info/storage.html
IndexedDB
Database that sort of replaces the now deprecated Web SQL. It works asynchronous and is a bit harder to understand as it uses stores, requests and transactions to deal with the data.
You can store any kind of objects in IndexedDB (Javascript objects, Blobs (files)).
You can also request storage space. User will be alerted if you need more than 5 mb (5 mb is not defined, but seem to be the limit most browsers set before asking user for permission).
See here for details on how you can use it:
http://www.w3.org/TR/IndexedDB/
http://www.html5rocks.com/en/tutorials/indexeddb/todo/
Web SQL
Although, as mentioned, deprecated it is still supported in browsers such as Safari. Is a database that works with SQL-queries and request, and works asynchronous.
Here are more details:
http://www.w3.org/TR/webdatabase/
http://html5doctor.com/introducing-web-sql-databases/
File API
Currently only supported in Chrome. Is a virtual file-system that works asynchronous as IndexedDB but is intended for large files (video and audio files etc.) but can just as easily be used for storing other data.
You can store any kind of objects in File API as Blobs (files). As it is a virtual file system you can navigate using folders.
You can also request storage space here as well (quota).
For details:
http://www.html5rocks.com/en/tutorials/file/dndfiles/
http://www.w3.org/TR/FileAPI/
And of course there is cookies and for IE UserData, but these are very limited.
This example demonstrates how to use local storage with Sencha Touch model objects:
http://www.mysamplecode.com/2012/06/sencha-touch-local-storage-example.html
If you're wanting to switch & sync data from online to offline you might also be interested in this example:
https://www.robertkehoe.com/2012/11/sencha-touch-2-localstorage-example/

Mac-AVAudioRecorder Select Microphone

In an Application I record audio from the microphone using AVAudioRecorder. I would like the user to be able to choose the microphone/recording settings they want to use, not just use the defaults from system preferences. However, I have not found any way to do this using AVAudioRecorder. Is it possible to do this using AVAudioRecorder, and if not, could I use Core Audio or something else to do this? If so, how would I do this?
You may need to go a bit more low level than AVAudioRecorder, which probably gets its settings & inputs from whatever the user has specified as the defaults in the "Sound" system preference pane.
Perhaps you could consider trying some of the AVCapture* classes?
You can specify a different audio input via the "AVCaptureDeviceInput" class, and there's some nice sample code available from Apple including AVRecorder.

Using JSON to update app's content in iOS

I'm about to create an application that uses JSON to update its content.
This is how I planned it to work:
When application starts, it checks (with internet connection is available) if the JSON file set on remote server is newer than the one stored localy - if it is then it's downloaded.
Then, the application applies data from that JSON to the content. For example, to the "Contact" information - it applies data like phone numbers etc.
My question is, is it in your opinion, a good technique to update appliactions content?
Does anynone had an experience with building app with this kind of idea?
Best regards,
Zin
Of course you can do this. One thing that may lead to a better user experience would be to ask the user for his permission to download new content (if there is something new).
This is a normal thing to do. I have a phonebook app that does exactly this. On a side note, if you need a network class to handle the web-service interaction, see this SO post. I wrote a custom network class that works with AFNetworking.

iOS 5 ics (iCalendar) reading/parsing from webURL

since iOS5 there ist the possibility to set an EKEventSource to EKSourceTypeCalDAV. Does anybody know if it is possible to receive events from a webUrl?
The webURL (lets take the google calendar as an example) returns the data in an ics file (iCalendar format)
I do not want the iCal-App to read the ics data, but to use the Eventkit framework to receive events within my own app.
Thanks in advance.
It isn't possible to "set an EKEventSource to EKSourceTypeCalDAV". EKSourceTypeCalDAV just tells you that the particular EKSource is a CalDAV account, as opposed to one of the other types that can be configured in iOS. sourceType is a read-only property.
For clarity, an EKSource object is retrieved from an EKEventStore, which represents the iOS Calendar database. I'm not aware of an "EKEventSource".
EventKit isn't suitable for your purposes, it is for interacting with events contained within the iOS Calendar database (and app). But you can use this project to import external ics file,
Ical for Objective-c