Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Accilies

By: a guest on Sep 10th, 2010  |  syntax: None  |  size: 3.01 KB  |  views: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. UserLookup:
  2.  
  3. -(void) searchUser{
  4.                 getUserDetailsService=[[GetUserDetailsSOAPService alloc]init]; // where AbstractServiceProvider *getUserDetailsService; and @interface GetUserDetailsSOAPService : AbstractServiceProvider
  5.                 [getUserDetailsService setSettingPreference:settings];
  6.                 [settings release];
  7.                 [getUserDetailsService setDelegate:self];
  8.                 RequestDO * request = [[RequestDO alloc]init];
  9.                 request.userID=userIdInputField.text;
  10.                 [getUserDetailsService setRequestDO:request];
  11.                 [request release];
  12.                 NSManagedObjectContext *context = self.referringObject;
  13.                 [getUserDetailsService setReferringObject:context];
  14.                 [getUserDetailsService execute]; // This is the user search function.
  15.                 [getUserDetailsService release];
  16. }
  17.  
  18. -(void) editUserLookupSettings{
  19.         UserLookupSettings *viewVC = [[UserLookupSettings alloc] initWithNibName:@"UserLookupSettings" bundle:nil];
  20.         viewVC.title =  @"Settings for User Lookup";
  21.         NSManagedObjectContext *context = self.referringObject;
  22.         viewVC.referringObject = context;
  23.         [self.navigationController pushViewController:viewVC animated:YES];
  24.         // Manage memory
  25.         [viewVC release];
  26. }
  27. ------------------------------------------------------------------
  28. NOW @implementation GetUserDetailsSOAPService
  29.  
  30. -(void)execute{
  31.         TCodeSettings *fetch = [[TCodeSettings alloc] init]; // Where @interface TCodeSettings : NSObject <NSFetchedResultsControllerDelegate>
  32.         fetch.referringObject = self.referringObject;
  33.         resultsOfSettings = [fetch initCode]; // Code details given below. I think so is causing the error when this is called.
  34.         [fetch release];
  35.         self.userData = [[NSMutableDictionary alloc] init];
  36.         self.previewData = [[NSMutableArray alloc] init];
  37.        
  38.         // Creates new Request object and sets its url
  39.         NSString *URLReq = [self.settingPreference getSOAPPrefix];
  40.         URLReq=[URLReq stringByAppendingString:@"Z_USERLOOKUPWS"];
  41.         URLReq=[URLReq stringByAppendingString:[self.settingPreference getSOAPSuffix]];
  42.        
  43.         theRequest=[NSMutableURLRequest
  44.                                 requestWithURL:[NSURL URLWithString:URLReq]
  45.                                 cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
  46.                                 timeoutInterval:30.0];
  47.        
  48.         // Setting specific SOAP headers
  49.         // For SOAP content type is text/xml
  50.         .
  51.         .
  52.         .
  53.         [self makeReqest]; // AbstractServiceProvider we have makeRequest function and it works fine..
  54. }
  55. ------------------------------------------------------------------
  56. NOW @interface TCodeSettings : NSObject <NSFetchedResultsControllerDelegate>
  57.  
  58. - (NSFetchedResultsController *)initCode{
  59.         NSError *error;
  60.         if (![[self fetchedResultsController] performFetch:&error]) {
  61.         // Handle the error
  62.         }else {
  63.                 return fetchedResultsController;
  64.         }
  65. }
  66. ------------------------------------------------------------------
  67. NOW @interface UserLookupSettings : UITableViewController <NSFetchedResultsControllerDelegate>
  68.  
  69. - (void)viewDidLoad {  
  70.         NSError *error;
  71.         if (![[self fetchedResultsController] performFetch:&error]) {
  72.         // Handle the error
  73.         }
  74.         [super viewDidLoad];
  75. }
  76. ------------------------------------------------------------------