Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Deck of Cards
idteamProjectList
Card
labelObjectiveC
Code Block
borderColorGreen
langjava
titleJSON
CommunicationSingleton *CSS = [CommunicationSingleton sharedSingleton];
    
    //build an info object and convert to json
    NSError *requestError;
    NSHTTPURLResponse *responseHTTP;
    
    //get projectList
    NSMutableURLRequest *requestForSlugrequestForProjectList = [[NSMutableURLRequest alloc] init];
    
    NSString *teamRequestStringprojectListRequestString = [NSString stringWithFormat:@"%@teams%@%@/projects",[CSS getDefaultAPIURL],[CSS getSlug]];
    [requestForSlugrequestForProjectList setURL:[NSURL URLWithString:teamRequestStringprojectListRequestString]];
    [requestForSlugrequestForProjectList setHTTPMethod:@"GET"];
    [requestForSlugrequestForProjectList setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
    [requestForSlugrequestForProjectList setValue:[CSS getAuthorization] forHTTPHeaderField:@"Authorization"];
    
    NSData *responseForSlugresponseForProjectList = [NSURLConnection sendSynchronousRequest:requestForSlugrequestForProjectList returningResponse:&responseHTTP error:&requestError];
    
    [requestForSlugrequestForProjectList release];
    
    if ([responseHTTPresponseForProjectList statusCode] == 200NULL) {
        
            // Success. Team names array. Login Failed
    }
    else {
        
        NSError *error;
        NSArray *tempdictForSlugprojectList = [NSJSONSerialization JSONObjectWithData:responseForSlugresponseForProjectList options:NSJSONReadingMutableContainers error:&requestErrorerror];
        
   NSLog(@"How many teams I am partBOOL of: %d", [tempdictForSlug count]);
    }else{
success = [[ProjectManager sharedProjectManager] loadProjectsFromData:projectList];
        
        if (!success){
            
            // Login Failed. Failed to Load Projects List

        }
    }
Card
labelC#