Giter VIP home page Giter VIP logo

objc-holiday-properties-001's Introduction

Holiday Properties

Objectives

  1. Implement methods that access a property using self. ("self dot") notation.

Instructions

This lab is a revisiting of the Holidays portion of the Apples and Holidays lab. Because this lab is about accessing properties and not writing method names, we've provided the method names for you.

  1. Fork and clone this lab to your machine. Open the *.xcworkspace file and navigate to the FISAppDelegate.h header file. Add an NSDictionary property called database to FISAppDelegate.h below the existing window property; like this window property, database should also be strong and nonatomic.

  2. The test file is set up to populate the database dictionary so in the method implementations you will just be interacting with the property after it's been populated. Navigate to the FISAppDelegate.m implementation file and write out the method bodies, accessing the database property from within the current file by using self. ("self dot") notation. Run the tests with โŒ˜ U to check your work after solving each one:

  • holidaysInSeason: to return an array of all of the "holiday" keys in the sub-dictionary associated with the submitted "season" argument.

  • suppliesInHoliday:inSeason: to return the mutable array of all of the supplies for the submitted "holiday" in the submitted "season".

  • holiday:isInSeason: to return whether or not the submitted "season" contains a key that matches the "holiday" argument.

  • supply:isInHoliday:inSeason: to return whether or not the submitted "holiday" in the submitted "season" contains in its array the submitted "supply" string.

  • addHoliday:toSeason: to create a new key-value pair in the submitted "season" key's sub-dictionary that uses the submitted "holiday" as the key and sets up an empty mutable array as its value.

  • addSupply:toHoliday:inSeason: to insert the submitted "supply" argument into the mutable array of the submitted "holiday" key in the sub-dictionary of the submitted "season" key.

Hint: It is entirely acceptable (and encouraged) to reference your solution to the original "Apples and Holidays" lab when solving this lab.

objc-holiday-properties-001's People

Contributors

markedwardmurray avatar sarogers avatar johnss518 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.