Skip to content

Instantly share code, notes, and snippets.

View ivangodfather's full-sized avatar
🍂

Ivan Ruiz ivangodfather

🍂
View GitHub Profile
let query = PFUser.query()
//query.includeKey("photo")
query.getObjectInBackgroundWithId("ZEdXH1G0zj", block: { (object, error) -> Void in
if let user = object as? PFUser {
println(user.objectForKey("username"))
let file: PFFile = user.objectForKey("photo") as PFFile
if file.isDataAvailable == true {
println("YES")
} else {
println("NO")
class User: NSManagedObject {
@NSManaged var username: String
var firstLetter: String {
get {
let letter = String(username[advance(username.startIndex, 0)])
return letter
}
}
}
I want to order by username, and section firstLetter (a,b,c,d...)
I made firstLetter optional and sectionIdentifier transitient & optional
class User: NSManagedObject {
@NSManaged var username: String
@NSManaged var firstLetter: String
var sectionIdentifier: String {
get {
firstLetter = String(username[advance(username.startIndex, 0)])
var expensiveVenuePredicate: NSPredicate = {
var predicate = NSPredicate(format: "priceInfo.priceCategory == %@", "$$$")
return predicate!
}()
vs
var expensiveVenuePredicate: NSPredicate = NSPredicate(format: "priceInfo.priceCategory == %@", "$$$")
let friend = parseFriendArray[indexPath.row] as ParseFriend
println(friend)
println(friend.status)
OUTPUT
<Friend: 0x7feb78c3f380, objectId: 4lg4EqftgH, localId: (null)> {
fromUser = "<PFUser: 0x7feb78c542c0, objectId: k380X271Ap>";
status = 0;
toUser = "<PFUser: 0x7feb78c55790, objectId: CmAFklTdhj>";
}
if (product.descripcion) {
cell.descripcion.text = [product.descripcion substringToIndex:30];
}
//Creating the UIView for the inputAccesoryView
class KeyBoardNext: UIView {
func inputAccessoryView() -> UIView {
let button = UIButton()
button .setTitle("Next", forState: UIControlState.Normal)
button.backgroundColor = UIColor.greenColor()
return button
}
}
//
#import "SongsViewController.h"
#import "AppDelegate.h"
#import "TrackTableViewCell.h"
#import "Track.h"
#import "Tag.h"
#import "SongViewController.h"
#import "variables.h"
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"im here");
return 95;
}
~/Desktop$ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB splash.png splashNEW.png
| pngcrush 1.6.4
| Copyright (C) 1998-2002,2006 Glenn Randers-Pehrson
| Copyright (C) 2005 Greg Roelofs
| This is a free, open-source program. Permission is irrevocably
| granted to everyone to use this version of pngcrush without
| payment of any fee.
| Executable name is pngcrush
| It was built with libpng version 1.2.7, and is