Thursday, July 2, 2009

Med on iPhone - Diabetes

From Johnson & Johnson


From the WWDC 2009

Wednesday, June 24, 2009

Good Cocoa sources


from DavidPhillipOster's post


http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/0321503619/ -
Aaron HIllegass' book on Mac programming
file:///Developer/Examples/AppKit/ - source code already on your
machine. Includes the source for Text Edit.
http://developer.apple.com/documentation/ - Tutorials on Mac
programming from Apple
http://developer.apple.com/samplecode/ - Sample code from Apple
http://borkware.com/quickies/ - a compendium of quick tips and tricks
http://theocacao.com/ - from the moderator of the Silicon Valley
chapter of Cocoaheads. Lots of sample code.
http://cocoaheads.org/ - The home page for Cocoaheads

Wednesday, June 3, 2009

Off this week to JAVAONE 2009

Sorry, no entries this week :-(

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];

}


Thursday, May 14, 2009