سؤال

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