Welcome, Guest
Username Password: Remember me

warning: Unable to restore previously selected frame.
(1 viewing) (1) Guest

TOPIC: warning: Unable to restore previously selected frame.

warning: Unable to restore previously selected frame. 1 year, 7 months ago #1

On different core data projects I get this error when I try to add an item. Here's the code I'm using:

 
model = [[SCTableViewModel alloc] initWithTableView:self.tableView withViewController:self];
 
SCClassDefinition *accountDef = [SCClassDefinition definitionWithEntityName:@"Tag"
withManagedObjectContext:self.managedObjectContext
withPropertyNames:[NSArray arrayWithObject:@"name"]];
 
SCArrayOfObjectsSection *objectSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:nil withEntityClassDefinition:accountDef];
objectSection.allowEditDetailView = YES;
objectSection.allowAddingItems = YES;
objectSection.addButtonItem = addButtonItem;
[addButtonItem release];
 
objectSection.footerTitle = @"Use tags to organize your items";
 
[model addSection:objectSection];
 


I get the error when I click the addButtonItem.
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4

Re: warning: Unable to restore previously selected frame. 1 year, 7 months ago #2

Hi Gary,

Unable to reproduce this error at all. Are you able to tell me how to recreate your "Tag" entity, or preferably, are you able to send this project at our support email? Thanks a lot.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: warning: Unable to restore previously selected frame. 1 year, 7 months ago #3

It happens for me when I assign the add button to the SCTableViewSection:

 
objectSection.addButtonItem = addButtonItem;
 
:

Is there a method that I can call directly from a selector method I'll assign to the button?

ie:
 
UIBarButtonItem *addButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonClicked:)];
 
...
 
- (void)addButtonClicked:(id)sender {
[[model sectionWithName:@"sectionName"] simulateAddButtonClick];
}
 
 


Now I don't know if SCTableViewModel has a method "sectionWithName" or any thing similar, I just made it up to get the section so I can request the simulatedButtonClicked method.

Gary
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4

Re: warning: Unable to restore previously selected frame. 1 year, 7 months ago #4

There is an SCArrayOfObjectsSection method called "didTapAddButtonItem" that you could use (inherited from SCArrayOfItemsSection). However, I still don't understand how just assigning the addButtonItem property generates this error. Would love to see this project
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: warning: Unable to restore previously selected frame. 1 year, 7 months ago #5

I'll have to simplify this project an send it to you. I believe the error is the result of [SCTableViewController shouldAutoRotateToInterfaceOrientation] getting caught in an infinite loop. It is repetitively called more than 30,000 times according to the stack.
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4

Re: warning: Unable to restore previously selected frame. 1 year, 7 months ago #6

Thanks a lot Gary, we'll also follow this lead and tell you if we find anything.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
Time to create page: 1.84 seconds