Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MMI/HomeTableViewController.m"
timestampString = "413364040.243194"
timestampString = "413406573.820451"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "155"
endingLineNumber = "155"
startingLineNumber = "199"
endingLineNumber = "199"
landmarkName = "-prepareForSegue:sender:"
landmarkType = "5">
</BreakpointContent>
Expand Down Expand Up @@ -148,27 +148,53 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MMI/HomeTableViewController.m"
timestampString = "413364353.245975"
timestampString = "413406573.820451"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "154"
endingLineNumber = "154"
startingLineNumber = "198"
endingLineNumber = "198"
landmarkName = "-prepareForSegue:sender:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MMI/HomeTableViewController.m"
timestampString = "413406573.820451"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "107"
endingLineNumber = "107"
landmarkName = "-tableView:cellForRowAtIndexPath:object:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MMI/CommentTableViewController.m"
timestampString = "413364910.933296"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MMI/HomeTableViewController.m"
timestampString = "413400833.913967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "93"
endingLineNumber = "93"
startingLineNumber = "94"
endingLineNumber = "94"
landmarkName = "-tableView:cellForRowAtIndexPath:object:"
landmarkType = "5">
</BreakpointContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
contextName = "-[HomeTableViewController tableView:cellForRowAtIndexPath:object:]:HomeTableViewController.m">
<PersistentStrings>
<PersistentString
value = "[queryComments findObjects]">
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
contextName = "-[ProfileTableViewController onFollowPressed:]:ProfileTableViewController.m">
<PersistentStrings>
Expand Down
51 changes: 38 additions & 13 deletions MMI/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JAc-UK-KDp">
<rect key="frame" x="20" y="409" width="140" height="30"/>
<rect key="frame" x="5" y="354" width="140" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Like">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
Expand All @@ -92,7 +92,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oK3-cS-2yv">
<rect key="frame" x="213" y="409" width="68" height="30"/>
<rect key="frame" x="213" y="354" width="68" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Comment">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
Expand All @@ -103,20 +103,21 @@
</connections>
</button>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Likes" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BI1-EZ-B0b">
<rect key="frame" x="20" y="366" width="41" height="21"/>
<rect key="frame" x="20" y="382" width="41" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Comments" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1FZ-Dk-kat">
<rect key="frame" x="20" y="389" width="85" height="21"/>
<rect key="frame" x="132" y="382" width="178" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<outlet property="commentsLabel" destination="1FZ-Dk-kat" id="BM3-j1-EG8"/>
<outlet property="likeButton" destination="JAc-UK-KDp" id="gpB-LM-Ktx"/>
<outlet property="photoImageView" destination="3LT-Gq-X4X" id="dYQ-oc-MkQ"/>
<outlet property="userLabel" destination="ybv-VA-bH4" id="Q8U-JJ-Plg"/>
Expand All @@ -143,19 +144,43 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<textField key="tableFooterView" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="iMV-DM-0Q7">
<rect key="frame" x="0.0" y="130" width="320" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<toolbar key="tableHeaderView" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="l32-dO-zrE">
<rect key="frame" x="0.0" y="64" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<items>
<barButtonItem style="plain" id="ymh-yu-FeZ">
<textField key="customView" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="iMV-DM-0Q7">
<rect key="frame" x="16" y="7" width="320" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</barButtonItem>
</items>
</toolbar>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" id="e68-9P-DVu">
<rect key="frame" x="0.0" y="86" width="320" height="44"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" textLabel="nqY-7E-9RZ" detailTextLabel="5Pl-50-RJM" style="IBUITableViewCellStyleValue1" id="e68-9P-DVu">
<rect key="frame" x="0.0" y="130" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="e68-9P-DVu" id="nGS-oh-mhg">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="nqY-7E-9RZ">
<rect key="frame" x="15" y="11" width="33" height="21"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="5Pl-50-RJM">
<rect key="frame" x="261" y="11" width="44" height="21"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
Expand Down
11 changes: 7 additions & 4 deletions MMI/CommentTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ - (IBAction)onAddCommentPressed:(id)sender {
PFObject *comment = [PFObject objectWithClassName:@"Comment"];
[comment setValue:commentTextField.text forKey:@"text"];
[comment setObject:currentUser forKey:@"createdByUser"];
[comment setObject:currentUser.username forKey:@"createdByUserName"];
[comment setObject:self.photo forKey:@"attachedToPhoto"];
[comment saveInBackground];
[self loadObjects];
}

#pragma mark - Table view data source
Expand All @@ -80,9 +82,9 @@ -(PFQuery *)queryForTable
PFQuery *queryComments = [PFQuery queryWithClassName:@"Comment"];
// [queryComments includeKey:@"createdByUser"];
// [queryComments includeKey:@"attachedToPhoto"];
[queryComments orderByDescending:@"createdAt"];
[queryComments whereKey:@"createdByUser" equalTo:currentUser.objectId];
[queryComments whereKey:@"attachedToPhoto" equalTo:self.photo.objectId];
[queryComments orderByDescending:@"createdAt"];
// [queryComments whereKey:@"createdByUser" equalTo:currentUser];
[queryComments whereKey:@"attachedToPhoto" equalTo:self.photo];

return queryComments;
}
Expand All @@ -98,7 +100,8 @@ -(PFTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS
cell = [[PFTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
}

cell.textLabel.text = [object objectForKey:@"text"];
cell.detailTextLabel.text = [object objectForKey:@"text"];
cell.textLabel.text = [object objectForKey:@"createdByUserName"];

return cell;
}
Expand Down
2 changes: 1 addition & 1 deletion MMI/FeedTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@property (weak, nonatomic) IBOutlet UIButton *likeButton;
@property UIButton *commentsButton;
@property UILabel *likesLabel;
@property UILabel *commentsLabel;
@property (weak, nonatomic) IBOutlet UILabel *commentsLabel;

@property PFObject *photo;
@end
Loading