Skip to content

Commit

Permalink
-Contact UP is now implemented, the formatting is not all correct but…
Browse files Browse the repository at this point in the history
… all labels and cells are implemented
  • Loading branch information
MilesCrabbe committed Jun 6, 2014
1 parent 335546c commit 02b373f
Show file tree
Hide file tree
Showing 17 changed files with 193 additions and 34 deletions.
14 changes: 13 additions & 1 deletion UniversityPrograms/UniversityPrograms.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
1B0A69221938DA8B005C821D /* UpcomingEventsTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B0A69201938DA8B005C821D /* UpcomingEventsTableViewCell.xib */; };
1B48B56819421640008F5186 /* DirectoryTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B48B56619421640008F5186 /* DirectoryTableViewCell.m */; };
1B48B56919421640008F5186 /* DirectoryTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B48B56719421640008F5186 /* DirectoryTableViewCell.xib */; };
1B48B56C19421C8F008F5186 /* Employee.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B48B56B19421C8F008F5186 /* Employee.m */; };
1B48B56F194243F9008F5186 /* UnRSVPDTO.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B48B56E194243F9008F5186 /* UnRSVPDTO.m */; };
1B7880DA1940EBED00333ED5 /* MyUPInitTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B7880D81940EBED00333ED5 /* MyUPInitTableViewCell.m */; };
1B7880DB1940EBED00333ED5 /* MyUPInitTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B7880D91940EBED00333ED5 /* MyUPInitTableViewCell.xib */; };
1B7880E01940EC8B00333ED5 /* ContactUPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B7880DE1940EC8B00333ED5 /* ContactUPViewController.m */; };
Expand Down Expand Up @@ -100,6 +102,10 @@
1B48B56519421640008F5186 /* DirectoryTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryTableViewCell.h; sourceTree = "<group>"; };
1B48B56619421640008F5186 /* DirectoryTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DirectoryTableViewCell.m; sourceTree = "<group>"; };
1B48B56719421640008F5186 /* DirectoryTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DirectoryTableViewCell.xib; sourceTree = "<group>"; };
1B48B56A19421C8F008F5186 /* Employee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Employee.h; sourceTree = "<group>"; };
1B48B56B19421C8F008F5186 /* Employee.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Employee.m; sourceTree = "<group>"; };
1B48B56D194243F9008F5186 /* UnRSVPDTO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnRSVPDTO.h; sourceTree = "<group>"; };
1B48B56E194243F9008F5186 /* UnRSVPDTO.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UnRSVPDTO.m; sourceTree = "<group>"; };
1B7880D71940EBED00333ED5 /* MyUPInitTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyUPInitTableViewCell.h; sourceTree = "<group>"; };
1B7880D81940EBED00333ED5 /* MyUPInitTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyUPInitTableViewCell.m; sourceTree = "<group>"; };
1B7880D91940EBED00333ED5 /* MyUPInitTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyUPInitTableViewCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -223,7 +229,6 @@
children = (
1BB198C7193FA4530017A1D6 /* UIColor+UPColors.h */,
1BB198C8193FA4530017A1D6 /* UIColor+UPColors.m */,
1BEC1BF8193914BE009DADEF /* UPDataRetrieval.m */,
);
name = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -404,6 +409,10 @@
1BB198DF193FB88E0017A1D6 /* RegistrantDTO.m */,
1BB198E1193FC4900017A1D6 /* LocationDTO.h */,
1BB198E2193FC4900017A1D6 /* LocationDTO.m */,
1B48B56A19421C8F008F5186 /* Employee.h */,
1B48B56B19421C8F008F5186 /* Employee.m */,
1B48B56D194243F9008F5186 /* UnRSVPDTO.h */,
1B48B56E194243F9008F5186 /* UnRSVPDTO.m */,
);
name = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -479,6 +488,7 @@
1BEC1BFD1939183C009DADEF /* NSObject+ObjectMap.h */,
1BEC1BFE1939183C009DADEF /* NSObject+ObjectMap.m */,
1BEC1BF7193914BE009DADEF /* UPDataRetrieval.h */,
1BEC1BF8193914BE009DADEF /* UPDataRetrieval.m */,
1B38F299193F6FD2005158D1 /* UPWebserviceConstants.h */,
);
name = "Web Calls";
Expand Down Expand Up @@ -656,6 +666,8 @@
1BAD1A43193CCCBA006D24AD /* MyUPViewController.m in Sources */,
1BAD1A38193CC2B9006D24AD /* Event.m in Sources */,
1B0A69161938D552005C821D /* CommentViewController.m in Sources */,
1B48B56C19421C8F008F5186 /* Employee.m in Sources */,
1B48B56F194243F9008F5186 /* UnRSVPDTO.m in Sources */,
1BACD35A1937E39700DF7081 /* AppDelegate.m in Sources */,
1BAD1A49193CCDEA006D24AD /* UserInfoViewController.m in Sources */,
1BAD1A3B193CC2C9006D24AD /* Comment.m in Sources */,
Expand Down
19 changes: 14 additions & 5 deletions UniversityPrograms/UniversityPrograms/ContactUPViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "ContactUPViewController.h"
#import "DirectoryTableViewCell.h"
#import "CommentViewController.h"

#import "Employee.h"
@interface ContactUPViewController ()

@property NSArray *directoryArray;
Expand All @@ -31,7 +31,8 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self.title=@"Contact UP";
self.tabBarItem.image=[UIImage imageNamed:@"Contact.png"];
self.tabBarItem.selectedImage=[UIImage imageNamed:@"Contact_filled.png"];
self.directoryArray = [[NSArray alloc] init];

self.directoryArray=[Employee buildArrayOfEmployees];
// Custom initialization
}
return self;
Expand Down Expand Up @@ -99,6 +100,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
if(!cell){
cell = [[DirectoryTableViewCell alloc] init];
}
Employee *e = [self.directoryArray objectAtIndex:indexPath.row-3];
[cell buildWtihEmployee:e];
return cell;
}

Expand All @@ -109,6 +112,10 @@ - (CGFloat)tableView:(UITableView *)tableview heightForRowAtIndexPath:(NSIndexPa
if(indexPath.row==1){
retVal=120.0f;

}
else if(indexPath.row>2){
retVal=108.0f;

}
else{
retVal=44.0f;
Expand All @@ -118,10 +125,12 @@ - (CGFloat)tableView:(UITableView *)tableview heightForRowAtIndexPath:(NSIndexPa
return retVal;

}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
CommentViewController *tappedEvent = [[CommentViewController alloc] init];
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.row==0){CommentViewController *tappedEvent = [[CommentViewController alloc] init];
[self.navigationController pushViewController:tappedEvent animated:YES];
[self.contactUPTableView reloadData];
[self.contactUPTableView reloadData];}
else {[self.contactUPTableView reloadData];}
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
//

#import <UIKit/UIKit.h>

#import "Employee.h"
@interface DirectoryTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *employeeImage;
@property (weak, nonatomic) IBOutlet UILabel *employeeName;
@property (weak, nonatomic) IBOutlet UILabel *employeeTitle;
@property (weak, nonatomic) IBOutlet UILabel *employeePhone;
@property (weak, nonatomic) IBOutlet UILabel *employeeEmail;


-(void)buildWtihEmployee:(Employee *)emp;
@end
11 changes: 11 additions & 0 deletions UniversityPrograms/UniversityPrograms/DirectoryTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//

#import "DirectoryTableViewCell.h"
#import "UIImageView+WebCache.h"
@import QuartzCore;

@implementation DirectoryTableViewCell
-(instancetype)init{
Expand All @@ -15,6 +17,15 @@ -(instancetype)init{

return self;
}
-(void)buildWtihEmployee:(Employee *)emp{
self.employeeEmail.text=emp.email;
//self.employeeImage.layer.cornerRadius=2;
[self.employeeImage setImageWithURL:[[NSURL alloc] initWithString:emp.imageURL]];
self.employeeName.text=emp.name;
self.employeePhone.text=emp.phone;
self.employeeTitle.text=emp.title;
self.employeeImage.layer.cornerRadius=8;
}
- (void)awakeFromNib
{
// Initialization code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="107"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="6DE-ol-0iM">
<rect key="frame" x="9" y="0.0" width="88" height="81"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="6DE-ol-0iM">
<rect key="frame" x="9" y="5" width="88" height="67"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="ffF-rs-6ll">
Expand Down
19 changes: 19 additions & 0 deletions UniversityPrograms/UniversityPrograms/Employee.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Employee.h
// UniversityPrograms
//
// Created by Miles Crabbe on 6/6/14.
// Copyright (c) 2014 CAPS. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Employee : NSObject
@property NSString *name;
@property NSString *title;
@property NSString *phone;
@property NSString *email;
@property NSString *imageURL;
-(instancetype)initWithName:(NSString *)name title:(NSString *)title phoneOrYear:(NSString *)phone emailOrMajor:(NSString *)email;
+(NSArray *)buildArrayOfEmployees;
@end
53 changes: 53 additions & 0 deletions UniversityPrograms/UniversityPrograms/Employee.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// Employee.m
// UniversityPrograms
//
// Created by Miles Crabbe on 6/6/14.
// Copyright (c) 2014 CAPS. All rights reserved.
//

#import "Employee.h"

@implementation Employee
-(instancetype)initWithName:(NSString *)name title:(NSString *)title phoneOrYear:(NSString *)phone emailOrMajor:(NSString *)email{
self.name=name;
self.title=title;
self.phone=phone;
self.email=email;

return self;
}
+(NSArray *)buildArrayOfEmployees{

Employee *e1 = [[Employee alloc] initWithName:@"LaToya Scott" title:@"Director" phoneOrYear:@"Phone: (205)348-9958" emailOrMajor:@"Email: [email protected]"];
e1.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_2.jpg";
Employee *e2 = [[Employee alloc] initWithName:@"Kimberly Jones" title:@"Program Assistant" phoneOrYear:@"Phone: (205)348-7525" emailOrMajor:@"Email: [email protected]"];
e2.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_7.jpg";
Employee *e3 = [[Employee alloc] initWithName:@"Averie Armstead" title:@"Graduate Assistant" phoneOrYear:@"Year: Graduate" emailOrMajor:@"Major: Sports Management"];
e3.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_15.jpg";
Employee *e4 = [[Employee alloc] initWithName:@"Jennifer McCollum" title:@"Graduate Assistant" phoneOrYear:@"Year: Graduate" emailOrMajor:@"Major: Public Administration"];
e4.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_9.jpg";
Employee *e5 = [[Employee alloc] initWithName:@"James Shetler" title:@"Graduate Assistant" phoneOrYear:@"Year: Graduate" emailOrMajor:@"Major: Advertising/Public Relations"];;
e5.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_13.jpg";
Employee *e6 = [[Employee alloc] initWithName:@"Britney Lee" title:@"Event Programmer" phoneOrYear:@"Year: Senior" emailOrMajor:@"Major: Public Relations"];
e6.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_14.jpg";
Employee *e7 = [[Employee alloc] initWithName:@"Taylor Johnson" title:@"Event Programmer" phoneOrYear:@"Year: Junior" emailOrMajor:@"Major: General Business"];
e7.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_6.jpg";
Employee *e8 = [[Employee alloc] initWithName:@"Runqiu (Candice) Ji" title:@"Event Programmer" phoneOrYear:@"Year: Junior" emailOrMajor:@"Major: Marketing"];
e8.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew.jpg";
Employee *e9 = [[Employee alloc] initWithName:@"Bonnika Ashley" title:@"Event Programmer" phoneOrYear:@"Year: Senior" emailOrMajor:@"Major: Computer Science"];
e9.imageURL=@"http://www.up.ua.edu/images/UP.jpg";
Employee *e10 = [[Employee alloc] initWithName:@"Reginald (Reggie) Allison II" title:@"Intern" phoneOrYear:@"Year: Graduate" emailOrMajor:@"Major: Telecommunication and Film"];
e10.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_16.jpg";
Employee *e11 = [[Employee alloc] initWithName:@"Allison Terrell" title:@"Communications Team" phoneOrYear:@"Year: Senior" emailOrMajor:@"Major: Public Relations"];
e11.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_11.jpg";
Employee *e12 = [[Employee alloc] initWithName:@"Brittney Wormely" title:@"Intern" phoneOrYear:@"Year: 2nd Year Law" emailOrMajor:@"Major: Law"];
e12.imageURL=@"http://www.up.ua.edu/images/UPWebsite-StaffNew_18.jpg";

NSArray *array = [[NSArray alloc] initWithObjects:e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, nil];

return array;
}


@end
9 changes: 3 additions & 6 deletions UniversityPrograms/UniversityPrograms/MyUPViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,9 @@ -(void)loadEvents{
[UPDataRetrieval getEvents:[[NSUserDefaults standardUserDefaults] valueForKey:@"cwid"] completetionHandler:^(NSURLResponse *response, NSData *data, NSError *e) {
self.sortedEventArray=[[NSMutableArray alloc] init];
self.unsortedEventArray=[NSObject arrayOfType:[Event class] FromJSONData:data];
//NSLog(@"%@",[[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding]);
NSArray *sortedArray = [self.unsortedEventArray sortedArrayUsingComparator:^NSComparisonResult(Event *event1, Event *event2) {
return [event1.startDate compare: event2.startDate];
}];
for (int index =0; index<sortedArray.count; ++index) {
Event *e=[sortedArray objectAtIndex:index];

for (int index =0; index<self.unsortedEventArray.count; ++index) {
Event *e=[self.unsortedEventArray objectAtIndex:index];
if(e.isRegistered==true){
[self.sortedEventArray addObject:e];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,19 @@ -(void)addAlertView{

}

-(void)addUnRSVPAlertView{
UIAlertView *unAlert = [[UIAlertView alloc] initWithTitle:@"un-RSVPed" message:@"You have un-RSVPed from this event, we hope to see you at other future events." delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[unAlert setTag:10];
[unAlert show];
}

- (void)alertView:(UIAlertView *)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex{
if(alertView.tag==1){
UserInfoViewController *tempInfoController =[[UserInfoViewController alloc]init];
[self.navigationController pushViewController:tempInfoController animated:YES];
}

else{

}
Expand Down Expand Up @@ -181,10 +188,10 @@ -(void)setUI{
}
//Check for in "happening now" and already done
else if([self.specifiedEvent.startDate isEarlierThan:[NSDate date]]&&[self.specifiedEvent.endDate isLaterThan:[NSDate date]]){
self.eventStartTime.text=[NSString stringWithFormat:@"The %@ is happening now",self.specifiedEvent.eventName];
self.eventStartTime.text=[NSString stringWithFormat:@"Happening Now"];
}
else{
self.eventStartTime.text=[NSString stringWithFormat:@"The %@ has already happened", self.specifiedEvent.eventName];
self.eventStartTime.text=[NSString stringWithFormat:@"Already Happened"];
}
[self.loadingIndicator stopAnimating];

Expand Down Expand Up @@ -214,15 +221,21 @@ - (void)didTapRSVP {
[self confirmAlertView];
[self.loadingIndicator startAnimating];
[self getEvent:self.specifiedEvent];
self.navigationItem.rightBarButtonItem=nil;

});

}];
}

}
-(void)didTapUnRSVP{

[UPDataRetrieval unrsvp:[[NSUserDefaults standardUserDefaults]stringForKey:@"cwid"] event:self.specifiedEvent completetionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[self addUnRSVPAlertView];
[self getEvent:self.specifiedEvent];

});
}];
}

#pragma mark - ScrollView Delegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 days from now" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="oTV-hX-VMR">
<rect key="frame" x="174" y="4" width="138" height="21"/>
<rect key="frame" x="158" y="4" width="154" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down
2 changes: 2 additions & 0 deletions UniversityPrograms/UniversityPrograms/UPDataRetrieval.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
+(void)getEvents:(NSString *)cwid completetionHandler:(void (^__weak)(NSURLResponse *, NSData *, NSError *))block;

+(void)getSpecificEvent:(NSString *)cwid eventID:(NSString *)eventID completetionHandler:(void (^__weak)(NSURLResponse *, NSData *, NSError *))block;

+(void)rsvpEvent:(NSString *)cwid event:(Event *)event completetionHandler:(void (^__weak)(NSURLResponse *, NSData *, NSError *))block;

+(void)submitComment:(NSString *)cwid comment:(Comment *)comment completetionHandler:(void (^__weak)(NSURLResponse *, NSData *, NSError *))block;

+(void)retrieveComments:(NSString *)cwid completetionHandler:(void (^__weak)(NSURLResponse *, NSData *, NSError *))block;

+(void)unrsvp:(NSString *)cwid event:(Event *)event completetionHandler:(void (^__weak)(NSURLResponse *, NSData *, NSError *))block;
@end
21 changes: 20 additions & 1 deletion UniversityPrograms/UniversityPrograms/UPDataRetrieval.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "NSObject+ObjectMap.h"
#import "UPWebserviceConstants.h"
#import "RegistrantDTO.h"
#import "UnRSVPDTO.h"

@implementation UPDataRetrieval
NSOperationQueue *opQueue;
Expand All @@ -24,8 +25,11 @@ +(NSOperationQueue *)_operationQueue


+(void)getEvents:(NSString *)cwid completetionHandler:(void (^__weak)(NSURLResponse *, NSData *, NSError *))block{

NSString *urlString = [NSString stringWithFormat:@"%@%@", UPWebserviceAddress, @"/api/Event/events"];

NSString *urlQueryString = [NSString stringWithFormat:@"?cwid=%@", cwid];

NSString *finalQueryString = [NSString stringWithFormat:@"%@%@", urlString, urlQueryString];

NSURL *url = [NSURL URLWithString:finalQueryString];
Expand Down Expand Up @@ -61,7 +65,22 @@ +(void)rsvpEvent:(NSString *)cwid event:(Event *)event completetionHandler:(void
[request setHTTPBody:registrantData];
[NSURLConnection sendAsynchronousRequest:request queue:[UPDataRetrieval _operationQueue] completionHandler:block];
}

+(void)unrsvp:(NSString *)cwid event:(Event *)event completetionHandler:(void (^__weak)(NSURLResponse *, NSData *, NSError *))block{
NSString *urlString = [NSString stringWithFormat:@"%@%@", UPWebserviceAddress, @"/api/Event/unrsvp"];
NSURL *url = [NSURL URLWithString:urlString];

NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:5.0];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];


UnRSVPDTO *unrsvp=[[UnRSVPDTO alloc]init];
unrsvp.cwid=[[NSUserDefaults standardUserDefaults] stringForKey:@"cwid"];
unrsvp.eventId=event.eventId;
NSData *unrsvpData= [unrsvp JSONData];
[request setHTTPBody:unrsvpData];
[NSURLConnection sendAsynchronousRequest:request queue:[UPDataRetrieval _operationQueue] completionHandler:block];
}

+(void)submitComment:(NSString *)cwid comment:(Comment *)comment completetionHandler:(void (^__weak)(NSURLResponse *, NSData *, NSError *))block{

Expand Down
Loading

0 comments on commit 02b373f

Please sign in to comment.