Greg’s Online CS 193P Resources

May 7, 2009

Fix them Now! – “warning: “Class” may not respond to -blah”

Filed under: cs 193p,Uncategorized — gregorykaiser @ 6:03 pm
Tags:

While working on Presence #2 I hit the stage where sending -initWithName messages to my Person class was causing the warning during compilation “warning: “Person” may not respond to ‘-initWithName:displayname:pictureUrl:timeline:’ Messages without a matching method signature…”. Then when the code ran it threw an exception. It took 20 minutes for me to figure out why (I know – dumb me). I had typed “displayname:” and not displayName:” . If you see this warning look for typos and fix them before actually trying to run your application. I post this entry so as not to forget this lesson.
warnings1
I also set my default editor font up from the default ’10’ size to ’12’ after this so I could more easily “see” small errors like this. You do this in the Xcode>Preference..>Fonts&Colors window.

Advertisements

4 Comments »

  1. Hi Greg,

    Although off-topic I wasn’t sure how to email you a question.
    I have struggled a bit with how to get to the data inside
    a twitter message. For instance, I can get to the items inside
    a tweet that have underscores like this:

    NSDictionary *dict = [[NSDictionary alloc] initWithDictionary: [TwitterHelper fetchInfoForUsername:@”THE_REAL_SHAQ”]];
    myFirst = [dict objectForKey:@”created_at”];
    NSLog(@”just one tweet %@”,myFirst);

    but can’t figure out how to get to the text of the message, which is something
    like this:

    “in_reply_to_user_id” = ;
    source = “TwitterBerry“;
    text = “Just had a bowl of heart to heart kashi cereal, not bad, on my way bak to shaq 24 hour fitness, 8 pack here I come”;
    truncated = 0;

    Do you know how I can refer to the text?

    Thanks, and sorry to be off-topic.

    Doug

    Comment by Doug — May 7, 2009 @ 6:19 pm | Reply

  2. Doug,

    The timeline seems to be an Array (one entry per status update) of Dictionaries.(keys for the fields to the left).

    So I used

    NSLog(@”Status at index 0:%@”, [[p.timeline objectAtIndex:0] objectForKey:@”text”]);

    to get

    2009-05-07 11:34:35.582 PresDemo[10806:20b] Status at index 0:I am writing some thank you notes on kid pix and am in need a new ribbon for my imagewriter.. Does anyone know where I can get one??

    where p is my Person object.

    Hope that helps I know its the little things that slow me down too. Which is very on topic in this case 😉

    Greg

    Comment by gregorykaiser — May 7, 2009 @ 6:41 pm | Reply

  3. Hi Greg,

    I am stuck in Presence 2. I was wondering if you can help me. I am not able to figure out how to pass data between the two views (list view and detail view) without using App Delegate. I have defined a class Person to store the screenName and statusMessages. I have a method to initialize the values within Person.m. Just before pushing the next view onto the stack (in the didselectrow), I call the method to initialize the Person object with the values at the indexPath.row. The problem is how to read this in the DetailViewController?

    Would really appreciate any pointers that you can provide.

    REgards,
    Aky

    Comment by aky25 — May 11, 2009 @ 7:14 pm | Reply

  4. Aky I sent you an e-mail.

    Comment by gregorykaiser — May 11, 2009 @ 9:42 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: