Monday, May 18, 2009
Sunday, May 17, 2009
Assignment 1B
#import <
#import <
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];
}
Thursday, May 14, 2009
Tuesday, May 12, 2009
Sunday, May 10, 2009
Thursday, May 7, 2009
Wednesday, May 6, 2009
Tuesday, May 5, 2009
Amazing Slider App and Assignment 1A
This from class 1:


Off to College
Evan Doll edoll@stanford.edu
Alan Cannistraro accannis@stanford.edu
Monday, May 4, 2009
First Entry
So can it be developed upon? Apparently so. Thousands of apps are already available.
Sites:
- Stack Overflow - Objective-C
- Cocoa Builder
- iPhone development center
- iPhone Dev 101: Useful Cocoa Development Resources
- iPhone Dev 101: Downloading and Installing the iPhone SDK
- iPhone Dev 101: Creating Xcode projects, brief Xcode UI overview
- iPhone Dev 101: The "Hello World!" app
- iPhone Reference Library
- iPhone Getting Started Guides
- iPhone Dev SDK - community for the iPhone developer community
- Cocoa Dev
- iCodeBlog - check this OUT!
- Apps Amuk - 31 programs in 31 days
- Napkin Code - great iPhone 3 stuff
- TUAW on Stanford
- Stanford iPhone classes on iTunes
- Stanford CS193P Page
- Professor Bohon's blog on TUAW
- Apple Dev Forums available to iPhone Developer Program members $99
- iPhone Dev SDK Form
- Stanford iPhone Class Applications
- iPhone Application Programming Guide
- iPhone Human Interface Guide
- iPhone getting started with Graphics and Animation
- iPhone user experience
- iPhone Performance
- iPhone Audio and Video Coding How-Tos
- iPhone Networking and Internet How-Tos
- iPhone Developer Topics
- iPhone OS Frameworks
- iPhone Developer Tools
- iPhone SDK Release Notes
- iPhone Bug Reporting
- Learn Objective-C
- Conceptual Objective-C
- More Objective-C and OOP in Objective-C Theory




