baker icon indicating copy to clipboard operation
baker copied to clipboard

What's the right way to open BakerView on a specific page?

Open georgemckibbin opened this issue 13 years ago • 1 comments

I've implemented my own "Favourites/Bookmarks/Starred" screen for a monthly magazine. From this screen I want to load the BakerView with a book. So I'm loading in a specific magazine on a specific page.

this is my code:

    NSString *bookPath = [favourite objectForKey:FAV_PAGE_BOOK_PATH];
    NSNumber *pageNumber = [favourite objectForKey:FAV_PAGE_NUMBER];

    BakerBook *book = [[BakerBook alloc] initWithBookPath:bookPath bundled:NO];
    book.currentPage = pageNumber;
    BakerViewController *bakerViewController = [[BakerViewController alloc] initWithBook:book];
    [bakerViewController changePage:[pageNumber intValue]];
    [self.navigationController pushViewController:bakerViewController animated:YES];
    [collectionView deselectItemAtIndexPath:indexPath animated:YES];

This essentially works (Although I don't think setting the currentPage on the book does anything) but I get some weird issues where sometimes I can't scroll between pages, and sometimes it will load the page and then switch to a different page. Weird stuff like that. Any tips as to the "right way" to do this?

Cheers.

georgemckibbin avatar Jul 09 '13 19:07 georgemckibbin

It's hard to tell... the BakerBook class has the item bakerStartAtPage (from -baker-start-at-page in the json) but that then gets overwritten by BakerBookStatus... maybe check that out...

folletto avatar Jul 19 '13 11:07 folletto