문제

I am using Leaves for a pdf reader app ..

I had set page number, UIScreen brightness etc. but I stuck here....

each page have BOOL bookmark value , if the page is bookmarked bookmarked image should shown in bookmark button , it can remove bookmark from bookmarked page ......

How can I add page as bookmark and display added bookmarks ?

thanks ....

도움이 되었습니까?

해결책

Try to use NSUSSER Default. Save that bookmark value into NSUSERDEfault and Then set the Blue image.

And check weather this value is present into NSUSerDefault if not then set the Black image. It's so easy...

Try this code

Create Defulat like this....

NSUserDefaults * BookMarkDefault=[NSUserDefaults standardUserDefaults];

Adding Value into Bookmanrk use this code once added that value then Set the blue image where you want to set.

[BookMarkDefault setObject:YoursavedData forKey:@"YourKey"];
 imgview.image=[UIImage imageNamed:@"Blue.png"];

dont forget to Synchronize the Default...

[BoomMarkDefault Synchronize];

if you want to get that data from NSUSerDefault check out this

NSLog(@"%@",[BookMarkDefault objectForKey:@"YourKey"]);

Try this code....

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top