Archive/ unarchive objects in iPhone OS 3.0 & 2.2.1
<p>I am trying to archive, unarchive objects using NSKeyedArchiver, NSKeyedUnarchiver, NSCoding (initWithCoder, encodeWithCoder methods) in order to access the last view before the application was terminated.</p>

<p>This works with OS 3.0 and above, but for OS 2.2.1, the objects are unarchived but a blank screen is displayed on application relaunch.</p>

<p>This is how I have been trying to initialize my view:</p>

<pre><code>- (id)initWithCoder:(NSCoder *)decoder{
    self = [super init];
    if (self != nil)
    {
        //my code
    }
    return self;

}
</code></pre>

<p>I also tried using initWithNibName method as follows</p>

<pre><code>- (id)initWithCoder:(NSCoder *)decoder{
    self = [super initWithNibName:@"myView" bundle:nil];
    if (self != nil)
    {
        //my code
    }
    return self;

}
</code></pre>

<p>But a black screen is displayed. </p>

<p>Can anyone please help?</p>
