Monday, May 18, 2009

Video on Objective-C

Video on Objective-C HERE.


Online Objective-C book

Helpful online book on Objective-C HERE.

Sunday, May 17, 2009

Assignment 1B

Done:

Good introduction to developing in Objective-C with the Foundation classes.
In this assignment (HERE) you get familiar with using the XCode IDE and its incredible documentation!


#import <Foundation/Foundation.h>

#import <stdio.h>


void PrintPathInfo() {

// Code from path info section here

NSLog(@"Printing Path");

NSString *path = @"~";

NSString *adjusted=[path stringByExpandingTildeInPath];

NSLog(adjusted);

NSLog([NSString stringWithFormat:@"My home folder is at '%@'",adjusted]);

NSArray *pathComponents = [adjusted pathComponents];

NSLog(@"Path Components Next");

for (NSString *pc in pathComponents) { 

NSLog(pc); 

}

}

void PrintProcessInfo() {

// Code from path info section here

NSLog(@"Printing PrintProcessInfo");

NSString *processName = [[NSProcessInfo processInfo] processName];

int processIdentifier = [[NSProcessInfo processInfo] processIdentifier];

NSString *answer = [NSString stringWithFormat:@"Process Name: %@ Process ID: %d", processName, processIdentifier];

NSLog(answer);

//NSLog(processName);

}

void PrintBookmarkInfo() {

NSLog(@"PrintBookmarkInfo()");

NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:5];

[dict setObject: [NSURL URLWithString:@"http://www.stanford.edu"] forKey: @"Stanford University"]; 

[dict setObject:[NSURL URLWithString:@"http://www.apple.com"] forKey@"Apple"]; 

  [dict setObject: [NSURL URLWithString:@"http://cs193p.stanford.edu"] forKey:@"CS193P"] ; 

  [dict setObject: [NSURL URLWithString:@"http://itunes.stanford.edu"] forKey: @"Stanford on iTunes U"]; 

[dict setObject: [NSURL URLWithString:@"http://stanfordshop.com"] forKey:@"Stanford Mall"] ; 

NSArray *keys;

keys = [dict allKeys];

for(NSString *key in keys) {

if([key hasPrefix:@"Stanford"]) {

NSURL *url = [dict objectForKey:key];

NSLog([NSString stringWithFormat:@"Key: %@  URL: %@",key,url]);

}

}

}

void PrintIntrospectionInfo() {

NSLog(@"PrintIntrospectionInfo");

NSMutableArray *arr = [NSMutableArray arrayWithCapacity:4];

[arr addObject:@"John G. Kroubalkian"];

[arr addObject:@"2John G. Kroubalkian"];

[arr addObject:@"3John G. Kroubalkian"];

[arr addObject:@"4John G. Kroubalkian"];

int count = [arr count];

for (int i = 0 ; i <>

NSObject *obj = [arr objectAtIndex:i];

//NSLog([NSString stringWithFormat:@"%@",obj]);

Class claz = [obj class];

NSString *className = [claz description];

NSLog([NSString stringWithFormat:@"Class name: %@",className]);

if([[arr objectAtIndex:i] isMemberOfClass:[NSString class]]){

NSLog(@"Is Member of NSString: YES");

}else{

NSLog(@"Is Member of NSString: NO");

}

if([[arr objectAtIndex:i] isKindOfClass:[NSString class]]){

NSLog(@"Is Kind of NSString: YES");

}else{

NSLog(@"Is Kind of NSString: NO");

}

//NSLog([NSString stringWithFormat: @"Is Member of NSString: %@",memberOfClassNsString]);

SEL sel = @selector(lowercaseString);

if ([obj respondsToSelector:sel]) {

NSLog(@"Responds to lowercaseString: YES");

NSString *res = [NSString stringWithFormat:@"lowercaseString is: %@", [obj performSelector:sel withObject:obj]];

NSLog(res);

}else{

NSLog(@"Responds to lowercaseString: NO");

}

}

}


int main (int argc, const char * argv[]) {

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];


PrintPathInfo();

PrintProcessInfo();

PrintBookmarkInfo();

PrintIntrospectionInfo();

    [pool drain];

}


Wednesday, May 6, 2009

Syncing iPhone picture

Taken with the Xcode Organizer from the Devices screen.

Tuesday, May 5, 2009

Lecture 2

Alan Cannistraro

Amazing Slider App and Assignment 1A

Isn't it amazing!?  Nah, not really.  But it gave me some more experience using Xcode and Interface Builder!

Not bad for a first class :-)

This from class 1:


















Assignment 1A

Apps coming...



Presence is a Twitter client for the iPhone



on-device development (i.e. deploying your iPhone app to your iPhone) requires a $99 investment in joining the iPhone Developer Program.

Off to College

CS193P: iPhone Application Development

Instructor:  Evan Doll (Apple)

Does this kind of make me a "Stanford Man"?


Full Moon on the Quad: A student gathering in the Main Quad of the university. Traditionally, seniors exchange kisses with freshmen, although students of all four classes (as well as the occasional graduate student or stranger) have been known to participate.



Evan Doll edoll@stanford.edu
Alan Cannistraro accannis@stanford.edu

Hello World App


Here is the historic Hello World app:


Monday, May 4, 2009

My First iPhone App

The boiler plate app:


First Entry

Very interested in one of the most revolutionary devices in my lifetime. The iPhone and its accompanying infrastructure (AppStore, iTunes, etc.)

So can it be developed upon? Apparently so. Thousands of apps are already available.

Sites: