Late, but catching up

3 views
Skip to first unread message

ruben d canlas jr

unread,
Mar 9, 2010, 12:37:04 PM3/9/10
to cocoahea...@googlegroups.com
Hi guys,

I just finished the Dictionary and NSURL part of Assignment 1. More to go hehe.

Just wanted to share some URL's I found of other bloggers working on the same course:


I'm hoping I can catch up with you guys -- trying to take advantage of my free evenings. 

.........................................................
RUBEN CANLAS JR.
MS Information Technology Mgt, MBA
.........................................................
Design Thinking, the Filipino Way
http://indiosign.com
.........................................................

ruben d canlas jr

unread,
Mar 9, 2010, 12:39:15 PM3/9/10
to cocoahea...@googlegroups.com
Btw, my solution used a bit less lines done he did (added the URLs and keys in one long list). 

His solution to the path were a bit more elegant than mine though :)

paul_sns

unread,
Mar 9, 2010, 9:25:34 PM3/9/10
to cocoaheads-manila
Great job! The first step is always the hardest. :)

You mentioned that you added all the URLS and keys in one long list,
so does this mean you used NSDictionary and initWithObjectsAndKeys
instead of creating an NSMutableDictionary and then setting the
objects one by one?

How did you implement the paths? I think I have a similar solution
with the blog you mentioned except I didn't call the description
method explicitly since logging an object using %@ notation already
does that for you.

Hope to see you in the upcoming Paparazzi meetups!

Cheers,
Paul

On Mar 10, 1:39 am, ruben d canlas jr <rubencan...@gmail.com> wrote:
> Btw, my solution used a bit less lines done he did (added the URLs and keys
> in one long list).
>
> His solution to the path were a bit more elegant than mine though :)
>

> On Wed, Mar 10, 2010 at 1:37 AM, ruben d canlas jr <rubencan...@gmail.com>wrote:
>
> > Hi guys,
>
> > I just finished the Dictionary and NSURL part of Assignment 1. More to go
> > hehe.
>
> > Just wanted to share some URL's I found of other bloggers working on the
> > same course:
>

> >http://lizarum.com/assignments/programming/objective_c/2009/first_obj...

ruben d canlas jr

unread,
Mar 9, 2010, 10:08:36 PM3/9/10
to cocoahea...@googlegroups.com
Thanks Paul.

Code excerpt:

NSMutableDictionary *dictionary = [NSMutableDictionary 
dictionaryWithObjectsAndKeys: 
 [NSURL URLWithString:@"http://www.standford.edu"], @"Stanford University", 
 [NSURL URLWithString:@"http://www.apple.com"], @"Apple",
[NSURL URLWithString:@"http://cs193p.stanford.edu"], @"CS193P", 
[NSURL URLWithString:@"http://itunes.stanford.edu"], @"Stanford on iTunes U", 
[NSURL URLWithString:@"http://stanfordshop.com"], @"Stanford Mall",          nil];

NSString *key;
NSURL *url;
for (key in dictionary) {
url = [dictionary objectForKey:key];
if ([key hasPrefix:@"Stanford"]) { // Print only keys that start with Stanford
NSLog(@"Key: '%@' URL: '%@'", key, url);
}


.........................................................
RUBEN CANLAS JR.
MS Information Technology Mgt, MBA
.........................................................
Design Thinking, the Filipino Way
http://indiosign.com
.........................................................


Reply all
Reply to author
Forward
0 new messages