IPhone database storage

Hi
My application have two databases. One that's static and one created by the user that should survive an appstore update of the application.
Where should I put the user created database?
Code sample?

You get bundle paths using the NSBundle class. To build document folder paths, you first retrieve the path to the Documents directory using the NSSearchPathForDirectoriesInDomains() function, then construct the rest of the path using NSString's stringByAppendingPathComponent: method.
My own code includes a little helper class to make this all simpler. You should be able to work out how to use both bundle paths and document folder paths by studying it.
* ArchUtils.h
* ArchUtils (C) 2008 Brent Royal-Gordon.
* You may use this in your own code as you wish, provided you leave this
* copyright notice intact.
#import <Foundation/Foundation.h>
typedef enum ArchUtilsDirectory {
ArchUtilsDocumentDirectory, /* Documents folder */
ArchUtilsResourceDirectory, /* Application bundle */
ArchUtilsTemporaryDirectory /* Temporary folder */
} ArchUtilsDirectory;
@interface ArchUtils : NSObject
+ (NSString*)pathForDirectory:(ArchUtilsDirectory)dir;
+ (NSString)pathForFile:(NSString)filename
inDirectory:(ArchUtilsDirectory)dir;
+ (NSString)pathForFile:(NSString)filename
ofType:(NSString*)type
inDirectory:(ArchUtilsDirectory)dir;
@end
* ArchUtils.m
* ArchUtils (C) 2008 Brent Royal-Gordon.
* You may use this in your own code as you wish, provided you leave this
* copyright notice intact.
#import "ArchUtils.h"
@implementation ArchUtils
+ (NSString*)pathForDirectory:(ArchUtilsDirectory)dir {
NSArray * paths;
NSString * path;
switch(dir) {
case ArchUtilsDocumentDirectory:
paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
path = [[[paths objectAtIndex:0] retain] autorelease];
break;
case ArchUtilsResourceDirectory:
path = [[NSBundle mainBundle] resourcePath];
break;
case ArchUtilsTemporaryDirectory:
path = NSTemporaryDirectory();
break;
return path;
+ (NSString)pathForFile:(NSString)filename
inDirectory:(ArchUtilsDirectory)dir {
if(dir == ArchUtilsResourceDirectory) {
return [[NSBundle mainBundle] pathForResource:filename ofType:nil];
else {
return [[self pathForDirectory:dir] stringByAppendingPathComponent:filename];
+ (NSString)pathForFile:(NSString)filename
ofType:(NSString*)type
inDirectory:(ArchUtilsDirectory)dir {
if(dir == ArchUtilsResourceDirectory) {
return [[NSBundle mainBundle] pathForResource:filename ofType:type];
else {
return [self pathForFile:[filename stringByAppendingPathExtension:type] inDirectory:dir];
@end

Similar Messages

  • HT4191 iPhone Local Storage "My iPhone" - How do you create this folder for use by the Notes app on a iPhone or iPad?  If I want to keep some notes only on my device and not in a cloud environment associated with an e-mail account.

    iPhone Local Storage "My iPhone" - How do you create this folder for use by the Notes app on a iPhone or iPad?  If I want to keep some notes only on my device and not in a cloud environment associated with an e-mail account.  I've seen reference to the  "My iPhone" local storage put no mention on how you create this folder or access this folder within the Notes app.  I realize storing information in a local storage like this provides no syncing between other iDevices but that is exactly what I'm looking for.  I'm running iOS7.0.4 on a iPhone 5S, and a iPad Air.  Any help would be greatly appreciated.

    If you go to Settings > Notes > Default Account you will see "On My iPhone" as the default account and the only choice if you have not enabled syncing Notes in Settings >iCloud or Settings > Mail, Contacts, Calendars. If you have enabled syncing you can still select "On My iPhone" as the default account. When you are in the Notes app you won't see any accounts listed if you have not enabled syncing because they are all in the On My iPhone account and that is the only place possible. It is not a folder that you create.

  • My iphone 5c storage is almost full and I need to delete some pictures to free up some space, I pay iCloud for extra storage but I'm afraid if I delete it off my phone that it will delete it from iCloud, is that true? I can't afford to lose these pictures

    My iphone 5c storage is almost full and I need to delete some picture to free up some space. If I delete the pictures off of my phone, will they be deleted off of iCloud as well? I cant afford to lose these pictures.

    http://support.apple.com/kb/HT4083
    Then take pics etc off iphone into a secure location on PC/Mac

  • Using iPhone as Storage for any docs

    Does anyone know how can I user iphone as storage device? I had motorola phone with 8 gigs mem card, where I could drag any docs (word, excell or any pics and music) I know it's pain here already with all the podcasts that I downloaded to transfer to a different PC, how can I transfer Word docs?

    You mean you want to be able to take work files from one computer, upload them to the iPhone, then download them another, different computer? Just making sure I understand what you want to do.
    I do not know of any universal file transfer app like that, other than using some cloud-type storage perhaps as a go between computer(s) and iPhone.
    For MSOffice docs specifically, there is QuickOffice, which allows editing of MSOffice documents on the iPhone. QO transfers files between computer and the iPhone via an embedded (in the app on the iPhone) wifi web server. You enable the file transfer web server on the iPhone, and then connect via a URL in a web browser on any computer you wish that is on the same wifi subnet. Once the web page loads on the computer, you can upload or download files to/from the iPhone.
    Because of the app compartmentalization of the iOS, the office files on the iPhone would only be accessible from within QuickOffice.

  • DBCA can not use ASM for database storage due to following reason: Could no

    Hi
    I've a recently installed RAC11gR2(11.2.0.3) on HP-UX
    I installed Grid Infrastructure with grid user:
    Node1: # id grid
    uid=1100(grid) gid=1000(oinstall) groups=1031(dba),1021(asmdba)
    Node2: # id grid
    uid=1100(grid) gid=1000(oinstall) groups=1031(dba),1021(asmdba)
    I installed the Oracle Server with oracle user:
    Node1: # id oracle
    uid=1101(oracle) gid=1000(oinstall) groups=1031(dba),1021(asmdba),1033(oper)
    Node2: # id oracle
    uid=1101(oracle) gid=1000(oinstall) groups=1031(dba),1021(asmdba),1033(oper)
    All related Grid Infrastructure is functioning well in both nodes:
    $ crs_stat -t
    Name Type Target State Host
    ora.DATA.dg ora....up.type ONLINE ONLINE node03
    ora.FRA.dg ora....up.type ONLINE ONLINE node03
    ora....ER.lsnr ora....er.type ONLINE ONLINE node03
    ora....N1.lsnr ora....er.type ONLINE ONLINE node04
    ora.asm ora.asm.type ONLINE ONLINE node03
    ora.cvu ora.cvu.type ONLINE ONLINE node04
    ora.gsd ora.gsd.type OFFLINE OFFLINE
    ora....network ora....rk.type ONLINE ONLINE node03
    ora.oc4j ora.oc4j.type OFFLINE OFFLINE
    ora.ons ora.ons.type ONLINE ONLINE node03
    ora.scan1.vip ora....ip.type ONLINE ONLINE node04
    ora....SM1.asm application ONLINE ONLINE node03
    ora....03.lsnr application ONLINE ONLINE node03
    ora....d03.gsd application OFFLINE OFFLINE
    ora....d03.ons application ONLINE ONLINE node03
    ora....d03.vip ora....t1.type ONLINE ONLINE node03
    ora....SM2.asm application ONLINE ONLINE node04
    ora....04.lsnr application ONLINE ONLINE node04
    ora....d04.gsd application OFFLINE OFFLINE
    ora....d04.ons application ONLINE ONLINE node04
    ora....d04.vip ora....t1.type ONLINE ONLINE node04
    $
    The ASM instance are running well in both nodes
    Connected with oracle user, the listener has registered perfectly the ASM instance in each node:
    $
    $ lsnrctl status
    LSNRCTL for HPUX: Version 11.2.0.3.0 - Production on 16-MAY-2012 15:41:06
    Copyright (c) 1991, 2011, Oracle. All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for HPUX: Version 11.2.0.3.0 - Production
    Start Date 16-MAY-2012 15:24:19
    Uptime 0 days 0 hr. 16 min. 47 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
    Listener Log File /u01/app/grid/diag/tnslsnr/node03/listener/alert/log .xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=16.0.0.133)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=16.0.0.136)(PORT=1521)))
    Services Summary...
    Service "+ASM" has 1 instance(s).
    Instance "+ASM1", status READY, has 1 handler(s) for this service...
    The command completed successfully
    $
    $
    DATA & FRA disk group are created:
    $
    $ echo $ORACLE_SID
    +ASM1
    $
    $ asmcmd
    ASMCMD>
    ASMCMD> ls -lt
    State Type Rebal Name
    MOUNTED EXTERN N DATA/
    MOUNTED EXTERN N FRA/
    ASMCMD>
    ASMCMD>
    The big issue is... that the DBCA can not see the diskgroups. When I choose ASM Storage it can not see them. It shows the chart in blank and if i try to write the disk group, so the following message appears: can not use ASM for database storage due to following reason: Could not connect to ASM due to following error: ORA-01034 ORACLE not available
    What can be passing in this case... ?
    Thanks in advance

    Thanks both
    Really the problem initially was because of this:
    [INS-06006] Passwordless SSH connectivity not set up between the following node(s): [node1, node2]. CVU may reports "PRVF-4007 : User equivalence check failed for user "user"" for same error
    and I had to install node1 first and after node2 manually and perhaps for this the product was not well linked.
    I resolved the problem establishing the keys with the wizard and after copying the following files from node1 to node2
    /home/grid/.ssh -------> /home/grid/.ssh
    authorized_keys
    known_hosts
    This is the procedure if you run the wizard at the node1.
    The problem is that the wizard creates the keys incompletely...
    Thanks

  • ICloud photo library and iPhone/iPad storage space

    Hi,
    I use iCloud photo library beta for some time and it's a great feature for apple product. However, I'm a bit worried about what happend after some time. Now I have 20Gb of storage in iCLoud and 16Gb iPhone 6 and iPad air 2. On both of them is the "optimize iPhone/iPad storage" checked. What will happen after I would put 20Gb of photos to the iCloud and the iPhone and iPad wouldn't have enough storage to handle them (even when the photos are optimize)?
    Thanks for any response or a link where it is discussed,
    Jakub

    Hi jakudo,
    "optimize iPad/iPhone storage" means that photos don't have to take any storage capacity of your devices, if you are using your devices storage capacity e.g. for other content like music, apps etc. Your photos will be stored in the cloud and only a some of them are stored locally as long as you have storage space available. The only thing you have to do, is upgrading for more storage as soon as your passing the 20 GB.
    With kind regards,
    David

  • Database Storage location using DBCA

    I'm trying to create a database. I would like to put the database on drive M and the logs on drive N.
    I'm getting that if I want to do it during creation using DBCA I need to define the location on step 11 - Database Storage.
    When I click on Datafile I then click on File Location Variables do I change ORACLE_BASE, ORACLE_HOME or both?
    When I click on Redo Log Groups I then click on File Location Variables do I change ORACLE_BASE, ORACLE_HOME or both?
    Do I do anything with the Control files location?

    In that step you got File Name and File Directory menu.
    Change the paths in File Directory menu.
    Suppose you have create oradata folder in both M and N drives.
    System01.dbf M:\oradata
    redolog01a.log N:\oradata
    suggestion:- Please multiplex controlfiles and redo log files.

  • Link to "   Database Storage Consolidation with ASM White Paper " now fixed

    I cannot access document "Database Storage Consolidation with ASM White Paper " on http://www.oracle.com/technetwork/database/index-100339.html.
    The new link seems also to be broken http://www.oracle.com/technology/products/database/asm/pdf/db_storage_consolidation_wp%2012-05.pdf
    Link is now working.
    Edited by: P. Forstmann on 21 sept. 2010 08:51
    Edited by: P. Forstmann on 21 sept. 2010 08:51

    This link has been repaired.
    Regards, OTN

  • Iphone 4s Storage is full, Photo Stream is over full, cannot psynch with Itunes how do I fix this! Completely shutdown, apps on phone won't run correctly. HELP!!!!

    My Iphone 4S storage is full! Phone is not functioning correctly due to full storage.  Tried to backup and psych with Itunes, Back up worked (supposedly) but
    Itunes cannot psych due to being over capacity. Can't find how to edit files and delete stuff. 

    shut down "photo stream" , delete unused apps. export your photos from iPhone to PC and then delete all of your photos. But if you want to keep the photos on phone, maybe you will try some methods to compress the photo size in order to free up more storage.

  • Default Space for database storage

    What the heck is that?
    After I did a software update, this new feature showed up
    under "Security".
    1) It has a "Show Database" tab.
    2) It has a "Drag down" for mb (from 1mb to 500mb)
    bobo

    Safari now comes with SQLLite database storage for offline applications. An example is here:
    http://webkit.org/misc/DatabaseExample.html

  • Database storage

    I have a confusion regarding the database storage mechanism.
    I have created a tablespace
    CREATE TABLESPACE TEST
    DATAFILE '..\test01.DBF'
    SIZE 152k
    SELECT bytes FROM DBA_FREE_SPACE
    WHERE tablespace_name ='TEST'
    It shows 65536 bytes.
    But it is smaller then 152k.
    Why is it so??
    Please help me out.

    hello,
    as you have not specified extent clause i think it is initial extent oracle creates of 64k (65536/1024=64k) as it is ...oracle system-managed extents
    have a look at this
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/logical.htm#g23847
    this is extract from oracle docs
    For system-managed extents, Oracle determines the optimal
    size of additional extents, with a minimum extent size of 64 KB.
    If the tablespaces are created with 'segment space management auto',
    and if the database block size is 16K or higher, then Oracle manages
    segment size by creating extents with a minimum size of 1M.
    This is the default for permanent tablespaces.experts please correct me.....if i am wrong
    thanks and regards
    VD
    Edited by: Dixit on Sep 8, 2009 2:15 AM
    Edited by: Dixit on Sep 8, 2009 2:16 AM
    Edited by: Dixit on Sep 8, 2009 2:18 AM

  • Step for oracle database storage migration

    Hi all
    Need a help for database storage migration from old storage to new storage. Please advise and given step to migrate the database storage.
    Database version: 9i,10g(ASM),10g and 11g (ASM)

    Hi;
    Your question is not clear. Migration from what to what?
    For all migration question please review:
    Master Note For Oracle Database Upgrades and Migrations [ID 1152016.1]
    Different Upgrade Methods For Upgrading Your Database [ID 419550.1]
    Migration of Oracle Database Instances Across OS Platforms[ID 733205.1]
    How To Use RMAN CONVERT DATABASE on Source Host for Cross Platform Migration [ID 413586.1]
    PS:Please dont forget to change thread status to answered if it possible when u belive your thread has been answered, it pretend to lose time of other forums user while they are searching open question which is not answered,thanks for understanding
    Regard
    Helios

  • Does Partitions take up database storage space

    Thanks in advance.
    I have tables with partitions that do not have data stored in them yet, does partitions without data stored in them take up database storage? How do you measure the storage used by a tables partitions that do not have data stored in them yet?

    Is there a benefit to asking the same question over again? (If so, I'd love to hear it.)
    Or would you be willing to continue with the original thread at Oracle Table and Index Partitions storage consumption?

  • When syncing my iPhone the storage says OTHER what is other and how do you delete it or make it smaller  my 16g phone has 3G of other please help get rid of it

    iitWhen syncing my iPhone the storage says OTHER what is other and how do you delete it or make it smaller  my 16g phone has 3G of other please help get rid of it

    The following has some information that may help: http://osxdaily.com/2013/07/24/remove-other-data-storage-iphone-ipad/

  • Other is taking space from my iPhone 6 storage

    Hi,
    am facing a problem with my iPhone 6 storage which before i didn't have it.
    When i connect my iPhone to my mac and open iTunes it will show me the storage and others is taking most of my capacity. i tried third party app called clean mobile install it on my mac but it didn't solve the problem.
    please i need help
    Thanks,
    Ahmad ALNuaimi

    Where did you get the phone? FaceTime is banned in some countries in the Middle East. What had you done before it disappeared; did you possibly reset or restore the phone?
    If the above is not the issue, if you use Search by dragging down your finger from the center of the screen and you search for "Facetime" does it appear as an app? If it does, then you must have moved it into a folder or another page of the Home screen. If it is in a folder the folder name will be displayed.

Maybe you are looking for

  • Upgrade to mac

    Hi, I'm currently using Adobe CS3 Design Standard on a pc, it's a student version and in german. I'm tired of switching from my mac to pc everytime I need photoshop or indesign that's why I'd like to purchase an upgrade to mac, and if possible an eng

  • Odd problem with iPod 5G 30G and iTunes 8...

    It freezes when I plug in my iPod. I've tried with my friend's iPod Nano (newest) and my iPod touch 8G and it works properly... But iTunes freezes when I connect my iPod 5G 30G on Windows Vista. Funny thing (annoying) is that it (my iPod) works prope

  • IWeb Not Finding Internet Connection...

    I'm having an issue with iWeb. Ever since I hooked my internet up to a wireless router, when I click 'Publish All to MobileMe' I get a message stating that iWeb can't connect to the internet, despite the every other program working just fine. Another

  • OBIEE11.1.1.6 Weblogic server error.

    Hi All, I have installed OBIEE11G in Linux box.First 1 days it working fine without any issues,After my weblogic server was down.I cant able to start. I tryed below steps. - <MW_HOME>/domains/<DOMAIN_NAME>/servers/<SERVERNAME>/data/ldap/ldapfiles - R

  • Won't export to camera

    I am trying to put footage back onto DV using a Canon MVX350i. I have been going to Print Video but when recording starts all I get is blue footage on the camera. Any ideas? Thanks