Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>yes it replace with same variable and xcode not allowed to duplicate the same name of any object in same class so your application not compile until you not remove any one array name from class... </p> <p><strong>Update:-</strong></p> <p>In <code>AppDelegate.h</code> file just declare variable...</p> <pre><code>NSUserDefaults  *userDefaults; NSMutableArray *yourArray; </code></pre> <p>after...</p> <p>In <code>AppDelegate.m</code> Fille in <code>applicationDidFinishLonching:</code> Method</p> <pre><code>userDefaults = [NSUserDefaults standardUserDefaults];     NSData *dataRepresentingtblArrayForSearch = [userDefaults objectForKey:@"yourArray"];     if (dataRepresentingtblArrayForSearch != nil) {         NSArray *oldSavedArray = [NSKeyedUnarchiverunarchiveObjectWithData:dataRepresentingtblArrayForSearch];         if (oldSavedArray != nil)             yourArray = [[NSMutableArray alloc]initWithArray:oldSavedArray];         else             yourArray = [[NSMutableArray alloc] init];     } else {         yourArray = [[NSMutableArray alloc] init];     }     [yourArray retain]; </code></pre> <p>after that when you want to insert,update or delete Data from this userDefaults Use Bellow Code...</p> <p>For Delete record use bellow         </p> <pre><code>[appDelegate.yourArray removeObjectAtIndex:IndexValue];// define integer value here on IndexValue </code></pre> <p>         or     for insert record use bellow..</p> <p>        </p> <pre><code>[appDelegate.yourArray addObject:AddValueHere]; </code></pre> <p>or for replace whole array with new array then write this</p> <pre><code>appDelegate.yourArray = YourNewArray; [appDelegate.yourArray retain]; </code></pre> <p>after that for save whole your data <code>synchronize</code> <code>NSUserDefaults</code> like bellow...          </p> <pre><code>NSData *data=[NSKeyedArchiverarchivedDataWithRootObject:appDelegate.yourArray];     [appDelegate.userDefaults setObject:data forKey:@"yourArray"];     [appDelegate.userDefaults synchronize]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload