Skip to content

Instantly share code, notes, and snippets.

@nwg
Created April 17, 2012 21:52
Show Gist options
  • Save nwg/2409305 to your computer and use it in GitHub Desktop.
Save nwg/2409305 to your computer and use it in GitHub Desktop.
//
// SampleEntityLoader.h
// SocializeSDK
//
// Created by Nathaniel Griswold on 1/11/12.
// Copyright (c) 2012 Socialize, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Socialize/Socialize.h>
@interface SampleEntityLoader : UIViewController
@property (nonatomic, retain) IBOutlet UILabel *entityNameLabel;
@property (nonatomic, retain) IBOutlet UILabel *entityKeyLabel;
@property (nonatomic, retain) id<SocializeEntity> entity;
- (id)initWithEntity:(id<SocializeEntity>)entity;
@end
#import "SampleEntityLoader.h"
@implementation SampleEntityLoader
@synthesize entity = entity_;
@synthesize entityNameLabel = entityNameLabel_;
@synthesize entityKeyLabel = entityKeyLabel_;
- (id)initWithEntity:(id<SocializeEntity>)entity
{
self = [super init];
if (self) {
self.entity = entity;
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.entityKeyLabel.text = self.entity.key;
self.entityNameLabel.text = self.entity.name;
self.title = self.entity.name;
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment