Text Size
Monday, October 20, 2014

04.02.13

Basic Object file Xcode

Below is a simple Object in Xcode with header and implementation files example.

Header file Example: Photo.h

//
//  Photo.h
//  PhotoViewer
//
//  Created by Mike Zriel on 04/02/2013.
//

#import <Foundation/Foundation.h>

@interface Photo : NSObject

@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *filename;
@property (nonatomic, strong) NSString *notes;

@end

Implementation file Example: Photo.m

//
//  Photo.m
//  PhotoViewer
//
//  Created by Mike Zriel on 04/02/2013.
//

#import "Photo.h"

@implementation Photo

@synthesize name,filename, notes;

@end

This creates an object with 3 parameters name, filename and notes and create getters and setters using @symthesize.

Add comment


Security code
Refresh

Copyright © 2014 by Mike Zriel - Zriel.com