Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 1.72 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /////////////////in the ViewController.h
  2.  
  3. #import "ContactDataProvider.h"
  4.  
  5.  (void)viewDidLoad {
  6.                        
  7.     [super viewDidLoad];
  8.        
  9.         NSUserDefaults *deviceValue = [NSUserDefaults standardUserDefaults];
  10.         NSString *theInfo111 = [deviceValue stringForKey:@"device"];
  11.         NSArray *archivedArray = [NSKeyedUnarchiver unarchiveObjectWithFile:[self dataFilePath]];
  12.         data = [[NSMutableArray alloc] initWithArray:archivedArray];
  13.         ContactDataProvider *contactDataProvider = [[ContactDataProvider alloc]init];
  14.         if (contactDataProvider.addSong) {
  15.         }
  16.        
  17.                 else if (![data containsObject:theInfo111]) {
  18.                 [data addObject:theInfo111];
  19.                 contactDataProvider.addSong = NO;
  20.  
  21.         }
  22.  
  23.        
  24. }
  25.  
  26. ///////////////in ContactDataProvider.h
  27.  
  28. @interface {
  29. BOOL addContact;
  30.  
  31. ContactDataProvider *contactDataProvider;
  32.  
  33.  
  34.  
  35. }
  36.  
  37. @property (nonatomic, assign)  BOOL addContact;
  38. @property (nonatomic, retain)   ContactDataProvider *contactDataProvider;
  39.  
  40.  
  41.  
  42. ////////////inContactDataProvider.m
  43.  
  44. @synthesize contactDataProvider;
  45. - (id)initWithMainViewController:(BeamItViewController *)viewController {
  46.         self = [super init];
  47.        
  48.         if (self) {
  49.                 mainViewController = viewController;
  50.                 contactDataProvider = [[ContactDataProvider alloc]init];
  51.         }
  52.        
  53.         return self;
  54. }
  55.  
  56. (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
  57.         if (buttonIndex == 0) {
  58.                 //[self sendMyContact];
  59.                
  60.                 addSong = YES;
  61.  
  62.                 if (addSong = YES) {
  63.                         NSLog(@"addsong = yes");
  64.  
  65.                        
  66.                        
  67.                 }
  68.  
  69.                 songViewController = [[SongViewController alloc] initWithNibName:@"SongViewController" bundle:[NSBundle mainBundle]];
  70.                 [mainViewController.view addSubview:songViewController.view];
  71.                                        
  72.  
  73.                
  74.                
  75.         }
  76.        
  77.         else if (buttonIndex == 1) {
  78.                
  79.                 addSong = NO;
  80. }