Skip to content

Instantly share code, notes, and snippets.

# Both return Profile AR objects
@selected = @cart.items
@all = current_user.profile.friends
@unselected = @all.reject{|record| r == @selected.each (not sure about this part)}
- (void)viewDidLoad
{
[self setupPage];
[super viewDidLoad];
}
#pragma mark -
#pragma mark The Guts
- (void)setupPage
//
// WallrViewController.m
// Wallr
//
// Created by Peter Nicholls on 30/06/11.
// Copyright 2011 NA. All rights reserved.
//
#import "WallrViewController.h"
#import <QuartzCore/QuartzCore.h>
//
// WallrViewController.m
// Wallr
//
// Created by Peter Nicholls on 2/07/11.
// Copyright 2011 NA. All rights reserved.
//
#import "WallrViewController.h"
#import <QuartzCore/QuartzCore.h>
- (id)init
{
self = [super init];
if (self != nil)
{
dataPages = [[NSArray alloc] initWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:
@"Page 1", @"pageName",
@"Some text for page 1", @"pageText",
nil],
#import "DataSource.h"
#import "SynthesizeSingleton.h"
@implementation DataSource
SYNTHESIZE_SINGLETON_FOR_CLASS(DataSource);
//
// init
//
dataPages = [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"image1.png"],
[UIImage imageNamed:@"image2.png"],
nil];
#import "DataSource.h"
#import "SynthesizeSingleton.h"
@implementation DataSource
SYNTHESIZE_SINGLETON_FOR_CLASS(DataSource);
//
// init
//
- (void)setPageIndex:(NSInteger)newPageIndex
{
pageIndex = newPageIndex;
if (pageIndex >= 0 && pageIndex < [[DataSource sharedDataSource] numDataPages])
{
// NSArray *pageData =
// [[DataSource sharedDataSource] dataForPage:pageIndex];
//
// image_one.image = [pageData objectAtIndex:0];
- (void)setPageIndex:(NSInteger)newPageIndex
{
pageIndex = newPageIndex;
if (pageIndex >= 0 && pageIndex < [[DataSource sharedDataSource] numDataPages])
{
// NSArray *pageData =
// [[DataSource sharedDataSource] dataForPage:pageIndex];
//
// image_one.image = [pageData objectAtIndex:0];