Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 407573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:36:29+00:00 2026-05-12T17:36:29+00:00

I’m having trouble with section 4 of the stanford iphone class on assignment 1b.

  • 0

I’m having trouble with section 4 of the stanford iphone class on assignment 1b.

I am having trouble understanding how I will build the array and what
the assignment expects.

Should the array be a “global” variable? Where should I define that?
Will each of the other subfunctions add their variables to the array?
Is the PrintIntrospectionInfo function just there to enumerate through
and print all introspective info?

Where can I read up on the things they are asking for in this
assignment? What should I read up on?

I’m not taking the class so can someone send me their code? The
lessons build up on each other and I want to be able to proceed.

Here’s the assignment :

Objective-C has a number of facilities that add to its dynamic object-oriented capabilities.  Many
of these facilities deal with determining and using an object’s capabilities at runtime. 
Create a mutable array and add objects of various types to it. Create instance of the classes
we’ve used elsewhere in this assignment to populate the array: NSString, NSURL, NSProcessInfo,
NSDictionary, etc. Create some NSMutableString instances and put them in the array as well.
Feel free to create other kinds of objects also.
Iterate through the objects in the array and do the following:
1. Print the class name of the object.
2. Log if the object is member of class NSString.
3. Log if the object is kind of class NSString.
4. Log if the object responds to the selector “lowercaseString”.
Page 5 of 6
5. If the object does respond to the lowercaseString selector, log the result of asking the
object to perform that selector (using performSelector:)
CS193P Assignment 1B
Spring 2009 Doll/Cannistraro

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:36:29+00:00Added an answer on May 12, 2026 at 5:36 pm

    You can find your answers in cocoa and objective-c manuals that come with Xcode.

    #import <Foundation/Foundation.h>
    
    void printIntrospectionInfo()
    {
        NSMutableArray * array = [NSMutableArray arrayWithCapacity:5];
        [array addObject: [NSString stringWithString:@"Example NSString object"]];
        [array addObject: [NSMutableString stringWithString:@"Example NSMutableString object"]];
        [array addObject: [NSURL URLWithString:@"http://apple.com.au"]];
        [array addObject: [NSProcessInfo processInfo]];
        [array addObject: [NSDictionary dictionaryWithObject: @"DictObject" forKey: @"KeyObject"]];
        [array addObject: [NSNumber numberWithInt:123456]];
    
        SEL sel_lowercase = @selector(lowercaseString);
    
        int i;
        for (i = 0; i < [array count]; ++i)
        {
            id o = [array objectAtIndex:i];
    
            NSLog(@"%@", o);
            NSLog(@"Class name: %@", [[o class] className]);
            NSLog(@"Is Member of NSString: %@", ([o isMemberOfClass: [NSString class]] ? @"YES" : @"NO"));
            NSLog(@"Is Kind of NSString: %@", ([o isKindOfClass: [NSString class]] ? @"YES" : @"NO"));
            NSLog(@"Responds to lowercaseString: %@", ([o respondsToSelector: sel_lowercase] ? @"YES" : @"NO"));
    
            if ([o respondsToSelector: sel_lowercase])
                NSLog(@"lowercaseString: %@", [o performSelector: sel_lowercase]);
    
            NSLog(@"===================");
        }
    
    }
    
    
    int main(int argc, const char* argv[])
    {
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        printIntrospectionInfo();
        [pool release];
        return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.