Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
I ios-tutorial
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ios-general
  • ios-tutorial
  • Wiki
  • objective c basics

objective c basics · Changes

Page history
ar.kalmykov created page: objective c basics authored Nov 19, 2016 by Artem Kalmykov's avatar Artem Kalmykov
Hide whitespace changes
Inline Side-by-side
Showing with 12 additions and 20 deletions
+12 -20
  • objective-c-basics.md objective-c-basics.md +12 -20
  • No files found.
objective-c-basics.md
View page @ 3e352a9b
...@@ -2,36 +2,28 @@ https://www.tutorialspoint.com/objective_c/index.htm ...@@ -2,36 +2,28 @@ https://www.tutorialspoint.com/objective_c/index.htm
You should create an iOS application in Xcode, written in Objective-C. It should contain 2 classes: Organization and Employee, both of each are subclasses of NSObject. Organization should have the following properties: You should create an iOS application in Xcode, written in Objective-C. It should contain 2 classes: Organization and Employee, both of each are subclasses of NSObject. Organization should have the following properties:
* Public “name” of type NSString. * Public “name” of type `NSString`.
* Private “employees” of type NSArray<Employee>. * Private “employees” of type `NSArray<Employee>`.
And the following methods: And the following methods:
* Public` initWithName` initializer method, which accepts organization name as an input parameter.
* Public initWithName initializer method, which accepts organization name as an input parameter. * Public `addEmployeeWithName:` (accepts employee name as an input parameter with no return type), which creates a new employee and adds it to the array. The salary is random between 100 and 5000 and is divisible by 10 (e.g. 110, 4670).
* Public `calculateAverageSalary` method, which return the average salary of all employees.
* Public addEmployeeWithName: (accepts employee name as an input parameter with no return type), which creates a new employee and adds it to the array. The salary is random between 100 and 5000 and is divisible by 10 (e.g. 110, 4670). * Public `employeeWithLowestSalary` method, which returns one employee with the lowest salary in the organization.
* Public `employeesWithSalary:` method, which accepts one argument of type int - salary - and returns all employees with given salary as an array.
* Public calculateAverageSalary method, which return the average salary of all employees.
* Public employeeWithLowestSalary method, which returns one employee with the lowest salary in the organization.
* Public employeesWithSalary: method, which accepts one argument of type int - salary - and returns all employees with given salary as an array.
Employee should have the following properties: Employee should have the following properties:
* Private “firstName” and “lastName”, which are of type NSString. * Private “firstName” and “lastName”, which are of type `NSString`.
* Public “salary” of type `int`.
* Public “salary” of type int.
* Public readonly property “fullName”, which returns the conjuction of first name and last name. * Public readonly property “fullName”, which returns the conjuction of first name and last name.
And the following methods:
* Public initWithFirstName:lastName:salary: initializer method, which accepts first name, last name and salary as input parameters. And the following methods:
* Public `initWithFirstName:lastName:salary`: initializer method, which accepts first name, last name and salary as input parameters.
Application should create one organization and multiple employees, which are added to the organization. Than all of the methods should be demonstrated. Everything should be logged to NSLog.
Application should create one organization and multiple employees, which are added to the organization. Than all of the methods should be demonstrated. Everything should be logged to `NSLog`.
You should be able to answer the following questions: You should be able to answer the following questions:
......
Clone repository
  • autolayout
  • basic core data
  • basic networking
  • cocoapods
  • delegation
  • gcd and math
  • git tutorial
  • Home
  • ios basics
  • notifications
  • objective c basics
  • swift
  • ui table view