Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 12    Views: 94

broomla
I hate code!
Profile
Posts: 61
Reg: Oct 31, 2011
Prague
610
05/19/12 01:01 PM (13 years ago)

Add to favorite. Maybe someone also thinking about it

I trying to create now an "add picture to favorite" feature. I do it in this way. I've sent the data to plist which I put in Document folder and next I read my data and this works for me, but I lose some features in BT_imagesScreen. Although it doesn't matter so much for me, I would like the BT_imagesScreen had a full functionality. So, I decide to go the same way, but I started to write data in json file. And it works also, but I can to overwrite my data only and I can't to add. Here is code: NSArray *keys = [[NSArray alloc] initWithObjects:@"id", @"BT_imageItem", @"", nil]; NSMutableDictionary *dict = [[NSMutableDictionary alloc]init]; [dict setValue:keys forKey:@"childItems"]; SBJsonWriter *writer = [SBJsonWriter new]; NSString *jsonString = [writer stringWithObject:dict]; [writer release]; [jsonString writeToFile:dataFilePath atomically:YES encoding:NSASCIIStringEncoding error:nil]; Maybe someone also thinking about Add to favorite feature? Sorry for poor English
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/19/12 03:28 PM (13 years ago)
Subscribing to this thread - also interested! David buzztouchmods.com
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/19/12 06:30 PM (13 years ago)
Following - interested Fred
 
broomla
I hate code!
Profile
Posts: 61
Reg: Oct 31, 2011
Prague
610
like
05/20/12 12:23 PM (13 years ago)
Well, what I have at this moment... How I wrote above, I do it two ways: plist and json. Today regarding a plist. 1. I've created the Add to Favorite button on the BT_screen_images, so I can record and save data to plist. 2. I've created the BT_my_screen_images page and I've changed (void)fillImagesArray so that I can retrieve data from my plist. 3. I've created the Delete from Favorite button on BT_my_screen_images and I can delete data from plist. What can't I reach? When I have on the screen Photo 1, I can read only one objectForKey, that belong this pic (e.g. @"itemId"). The rest of data (@"imageTitle", @"itemType") unavailable for me. And actually I can manage only the photos NSMutableArray. (Its enough for my future app, because I have photo's description insde the photo instead the titleLabel). But why can't we use other BT_my_screen_images features? Task: How can we read the data from plist correctly? Here is how the favotite.plist looks: <plist version="1.0"> <array> <dict> <key>imageTitle</key> <string>Photo 1</string> <key>itemId</key> <string>161245743FD056B40843C4F</string> <key>itemType</key> <string>BT_imageItem</string> </dict> <dict> <key>imageTitle</key> <string>Photo 1</string> <key>itemId</key> <string>947211165A560BCFD1E6E3A</string> <key>itemType</key> <string>BT_imageItem</string> </dict> </array> </plist> Any suggestions... I hope, MrDavid will write the plugin "Add to Favorite" in closer future:) if we'll reach some answers in this teamwork. Sorry for poor English.
 
broomla
I hate code!
Profile
Posts: 61
Reg: Oct 31, 2011
Prague
610
like
05/20/12 03:10 PM (13 years ago)
oh sorry.... after page's refresh I got four copies my message
 
broomla
I hate code!
Profile
Posts: 61
Reg: Oct 31, 2011
Prague
610
like
05/20/12 03:10 PM (13 years ago)
oh sorry.... after page's refresh I got four copies my message
 
broomla
I hate code!
Profile
Posts: 61
Reg: Oct 31, 2011
Prague
610
like
05/20/12 03:10 PM (13 years ago)
oh sorry.... after page's refresh I got four copies my message
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/20/12 03:22 PM (13 years ago)
Hey Broomla, I will definitively package it up into a plugin if you can get this figured out - through all credits will be to your name :) David buzztouchmods.com
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/21/12 08:56 AM (13 years ago)
Hi Guys interesting, I have been looking for a solution for adding favorites within an app. Is this a solution or a theory? Mr David if you can create a plugin out of this it would be great. I'll be keeping an eye out.
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
05/22/12 08:14 AM (13 years ago)
i think i might be poking around in the same code/area as you @broomla i'm not looking to make an 'ADD TO FAVORITES' but i am trying to add some functions to the screen that sides up when looking at pictures in a BT 2.0 Image Gallery screen. right now it just has SAVE IMAGE EMAIL IMAGE Cancel is this the same screen/menu you are trying to put a 'ADD TO FAVORITES' link in? i'd love to learn and understand a more about that menu and how i can add to it or manipulate it. you def seem to have some great coding skills.
 
broomla
I hate code!
Profile
Posts: 61
Reg: Oct 31, 2011
Prague
610
like
05/22/12 08:26 AM (13 years ago)
@ATRAIN53, I've created a new toolbar, but I think, it doesn't matter which place on the screen you will use. Also I would like to remind, I still have a problem to read .plist file correctly as I wrote above... Some help from guru will appreciate.
 
broomla
I hate code!
Profile
Posts: 61
Reg: Oct 31, 2011
Prague
610
like
07/03/12 03:04 AM (13 years ago)
Hi,guys. The theme alive.... I'm working now for a new app ...
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
07/03/12 06:31 AM (13 years ago)
^ great to see you here! I'm still getting mileage from some of the code you sent me a while back. Great learning for myself to see how you modified the code. I've since learned I need to be using UIActionsheet to call up commands. I wonder if that might be where you can add a "Add to Favorites" action?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.