SlideShare a Scribd company logo
РАЗХВЪРЛЯНАТА
                             ПРЕЗЕНТАЦИЯ
                            Около първи етаж след основите




Thursday, December 22, 11
DOT SYNTAX
                                                                                         set
                            (.) alternative to ([]) to invoke accessor methods
                                                                                         get
                                                                                 self.age = 10;
         // Each member of the path is an object.
                                                                                 [self setAge:10];

         x = person.address.street.name;
         x = [[[person address] street] name];


                                        // The path contains a C struct.
                                        // This will crash if window is nil or -contentView
                                        returns nil.

                                        y = window.contentView.bounds.origin.y;
                                        y = [[window contentView] bounds].origin.y;



    // An example of using a setter.

    person.address.street.name = @"Oxford Road";
    [[[person address] street] setName: @"Oxford Road"];



Thursday, December 22, 11
CHAPTER 2
                                Defining a Class


        INSTANCE VARIABLES SCOPEFigure 2-‐1 illustrates the levels of scoping.

                                Figure 2-1       The scope of instance variables (@package scope not shown)



                                     The class that
                                      declares the              @private
                                   instance variable


                                                                                 @protected


                                      A class that
                                      inherits the                                            @public
                                   instance variable




                                                                   Unrelated code
    • default               : @protected

Thursday, December 22, 11
INSTANCE VARIABLES SCOPE

                            @interface Worker : NSObject
                            {
                                NSString *name;
                            @private
                                NSInteger age;
                                NSString *evaluation;
                            @protected
                                id job;
                                CGFloat wage;
                            @public
                                id boss;
                            }




Thursday, December 22, 11
@property

      @property float value;
      @property(copy, readwrite) NSString *value;


      @synthesize = напищи ми getter & setter

                Access                              Memory
                                                                                             Multithreaded environment
                                      (ARC)
  readwrite - default                 strong (owning)                                    By default, accessors are atomic.
  readonly - only the getter method   weak (non-owning)
                                                                                         nonatomic   returns the value
                                                                                         directly
                                      (MRC)
                                      copy
                                      The previous value is sent a release message.
                                      NSCopying  protocol.
                                      assign
                                      default. NSInteger, CGRect....
                                      retain
                                      upon assignment. The previous value is release-d


Thursday, December 22, 11
MEMORY MANAGEMENT



      Защо да създаваме обект:

       •   запазване на instance variable

       •   използване в метод


Thursday, December 22, 11
MEMORY MANAGEMENT
                                              Setter method


      - (void)setLastUpdatedDate:(NSDate *)newDate {
      ! if (newDate) {
      ! !      [lastUpdatedDate release];
      ! !      lastUpdatedDate = [newDate retain];
         }
      }

                                                       //Recommended code:
                                                       -(void) setName: (NSString *) theName
                                                       {
                                                          [name release]
                                                          name = [[NSString alloc] initWthString: theName];
                                                       }

                                                       //Incorrect code according to Kochan:
                                                       -(void) setName: (NSString *) theName
                                                       {
                                                          [name release]
                                                          name = [NSString stringWthString: theName];
                                                       }




Thursday, December 22, 11
MEMORY MANAGEMENT


                             NSNumber* value1 = [[NSNumber alloc] initWithFloat:8.75];
                            [self setTotal:value1];

                             NSNumber* value2 = [NSNumber numberWithFloat:14.78];
                            [self setTotal:value2];

                            // only release value1
                            [value1 release];




Thursday, December 22, 11
MESSAGES TO NIL
                                                [myArray release];
   id anObjectMaybeNil = nil;                     myArray = nil;

   // this is valid

   if ([anObjectMaybeNil methodThatReturnsADouble] == 0.0)

   {

             // implementation continues...

   }



Thursday, December 22, 11
TTIMAGEVIEW


                                   UIImageView




                            Name    Link   Title   Note

                                   TTImageView
Thursday, December 22, 11
XCODE


    • NSString

    • .plist

    • [NSUserDefaults               standardUserDefaults]

    • Custom                UIImageView class



Thursday, December 22, 11

More Related Content

What's hot

Grand Central Dispatch Design Patterns
Grand Central Dispatch Design PatternsGrand Central Dispatch Design Patterns
Grand Central Dispatch Design Patterns
Robert Brown
 
XSLT 1 and XPath Quick Reference (from mulberrytech.com)
XSLT 1 and XPath Quick Reference (from mulberrytech.com)XSLT 1 and XPath Quick Reference (from mulberrytech.com)
XSLT 1 and XPath Quick Reference (from mulberrytech.com)
FrescatiStory
 
Java synchronizers
Java synchronizersJava synchronizers
Java synchronizers
ts_v_murthy
 
Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩
HyeonSeok Choi
 
12 virtualmachine
12 virtualmachine12 virtualmachine
12 virtualmachine
The World of Smalltalk
 
Lecture 3: Storage and Variables
Lecture 3: Storage and VariablesLecture 3: Storage and Variables
Lecture 3: Storage and Variables
Eelco Visser
 
Java 5 concurrency
Java 5 concurrencyJava 5 concurrency
Java 5 concurrency
priyank09
 
Vba functions
Vba functionsVba functions
Vba functions
Wongyu Choe
 
Introduction To Core Data
Introduction To Core DataIntroduction To Core Data
Introduction To Core Data
danielctull
 
Code Contracts In .Net
Code Contracts In .NetCode Contracts In .Net
Code Contracts In .Net
Bruce Johnson
 
11 bytecode
11 bytecode11 bytecode
Oct 2012 state of project keystone
Oct 2012 state of project keystoneOct 2012 state of project keystone
Oct 2012 state of project keystone
Joseph Heck
 
Inheritance
InheritanceInheritance
Inheritance
Bhushan Mulmule
 
Unit7 jwfiles
Unit7 jwfilesUnit7 jwfiles
Unit7 jwfiles
mrecedu
 
Singleton
SingletonSingleton
Singleton
Arul Prasad
 
Singleton
SingletonSingleton
Singleton
arulslideshare
 
Network vs. Code Metrics to Predict Defects: A Replication Study
Network vs. Code Metrics  to Predict Defects: A Replication StudyNetwork vs. Code Metrics  to Predict Defects: A Replication Study
Network vs. Code Metrics to Predict Defects: A Replication Study
Kim Herzig
 
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtugVk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
ketan_patel25
 
Java oop
Java oopJava oop
Java oop
bchinnaiyan
 
Ruby 20th birthday
Ruby 20th birthdayRuby 20th birthday
Ruby 20th birthday
michele franzin
 

What's hot (20)

Grand Central Dispatch Design Patterns
Grand Central Dispatch Design PatternsGrand Central Dispatch Design Patterns
Grand Central Dispatch Design Patterns
 
XSLT 1 and XPath Quick Reference (from mulberrytech.com)
XSLT 1 and XPath Quick Reference (from mulberrytech.com)XSLT 1 and XPath Quick Reference (from mulberrytech.com)
XSLT 1 and XPath Quick Reference (from mulberrytech.com)
 
Java synchronizers
Java synchronizersJava synchronizers
Java synchronizers
 
Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩
 
12 virtualmachine
12 virtualmachine12 virtualmachine
12 virtualmachine
 
Lecture 3: Storage and Variables
Lecture 3: Storage and VariablesLecture 3: Storage and Variables
Lecture 3: Storage and Variables
 
Java 5 concurrency
Java 5 concurrencyJava 5 concurrency
Java 5 concurrency
 
Vba functions
Vba functionsVba functions
Vba functions
 
Introduction To Core Data
Introduction To Core DataIntroduction To Core Data
Introduction To Core Data
 
Code Contracts In .Net
Code Contracts In .NetCode Contracts In .Net
Code Contracts In .Net
 
11 bytecode
11 bytecode11 bytecode
11 bytecode
 
Oct 2012 state of project keystone
Oct 2012 state of project keystoneOct 2012 state of project keystone
Oct 2012 state of project keystone
 
Inheritance
InheritanceInheritance
Inheritance
 
Unit7 jwfiles
Unit7 jwfilesUnit7 jwfiles
Unit7 jwfiles
 
Singleton
SingletonSingleton
Singleton
 
Singleton
SingletonSingleton
Singleton
 
Network vs. Code Metrics to Predict Defects: A Replication Study
Network vs. Code Metrics  to Predict Defects: A Replication StudyNetwork vs. Code Metrics  to Predict Defects: A Replication Study
Network vs. Code Metrics to Predict Defects: A Replication Study
 
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtugVk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
 
Java oop
Java oopJava oop
Java oop
 
Ruby 20th birthday
Ruby 20th birthdayRuby 20th birthday
Ruby 20th birthday
 

Viewers also liked

iOS Memory management & Navigation
iOS Memory management & NavigationiOS Memory management & Navigation
iOS Memory management & Navigation
Marian Ignev
 
Какво е Startup?
Какво е Startup?Какво е Startup?
Какво е Startup?
Marian Ignev
 
iOS Development - Intro
iOS Development - IntroiOS Development - Intro
iOS Development - Intro
Marian Ignev
 
PaaS бъдещето на креативния програмист!
PaaS бъдещето на креативния програмист!PaaS бъдещето на креативния програмист!
PaaS бъдещето на креативния програмист!
Marian Ignev
 
iOS Tips + ModalVC
iOS Tips + ModalVCiOS Tips + ModalVC
iOS Tips + ModalVC
Marian Ignev
 
iOS UI Table Views
iOS UI Table ViewsiOS UI Table Views
iOS UI Table Views
Marian Ignev
 
iOS Views
iOS ViewsiOS Views
iOS Views
Marian Ignev
 
Step-by-Step Parse Migration
Step-by-Step Parse MigrationStep-by-Step Parse Migration
Step-by-Step Parse Migration
MongoDB
 
iOS Architecture and MVC
iOS Architecture and MVCiOS Architecture and MVC
iOS Architecture and MVC
Marian Ignev
 

Viewers also liked (9)

iOS Memory management & Navigation
iOS Memory management & NavigationiOS Memory management & Navigation
iOS Memory management & Navigation
 
Какво е Startup?
Какво е Startup?Какво е Startup?
Какво е Startup?
 
iOS Development - Intro
iOS Development - IntroiOS Development - Intro
iOS Development - Intro
 
PaaS бъдещето на креативния програмист!
PaaS бъдещето на креативния програмист!PaaS бъдещето на креативния програмист!
PaaS бъдещето на креативния програмист!
 
iOS Tips + ModalVC
iOS Tips + ModalVCiOS Tips + ModalVC
iOS Tips + ModalVC
 
iOS UI Table Views
iOS UI Table ViewsiOS UI Table Views
iOS UI Table Views
 
iOS Views
iOS ViewsiOS Views
iOS Views
 
Step-by-Step Parse Migration
Step-by-Step Parse MigrationStep-by-Step Parse Migration
Step-by-Step Parse Migration
 
iOS Architecture and MVC
iOS Architecture and MVCiOS Architecture and MVC
iOS Architecture and MVC
 

Similar to The messy lecture

iOS Session-2
iOS Session-2iOS Session-2
iOS Session-2
Hussain Behestee
 
Spring data
Spring dataSpring data
Spring data
명철 강
 
Runtime
RuntimeRuntime
Runtime
Jorge Ortiz
 
iPhone Memory Management
iPhone Memory ManagementiPhone Memory Management
iPhone Memory Management
Vadim Zimin
 
Declarative Name Binding and Scope Rules
Declarative Name Binding and Scope RulesDeclarative Name Binding and Scope Rules
Declarative Name Binding and Scope Rules
Eelco Visser
 
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legion
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legion«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legion
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legion
e-Legion
 
Defining classes-part-i-constructors-properties
Defining classes-part-i-constructors-propertiesDefining classes-part-i-constructors-properties
Defining classes-part-i-constructors-properties
CtOlaf
 
Core java concepts
Core    java  conceptsCore    java  concepts
Core java concepts
kishorethoutam
 
Python lec4
Python lec4Python lec4
Python lec4
Swarup Ghosh
 
constructors and destructors
constructors and destructorsconstructors and destructors
constructors and destructors
Akshaya Parida
 
Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code
Using Fuzzy Code Search to Link Code Fragments in Discussions to Source CodeUsing Fuzzy Code Search to Link Code Fragments in Discussions to Source Code
Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code
Nicolas Bettenburg
 
Getting Started with PL/Proxy
Getting Started with PL/ProxyGetting Started with PL/Proxy
Getting Started with PL/Proxy
Peter Eisentraut
 
Doctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperDoctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document Mapper
Jonathan Wage
 
Blocks and GCD(Grand Central Dispatch)
Blocks and GCD(Grand Central Dispatch)Blocks and GCD(Grand Central Dispatch)
Blocks and GCD(Grand Central Dispatch)
Jigar Maheshwari
 
JavaScript Libraries Overview
JavaScript Libraries OverviewJavaScript Libraries Overview
JavaScript Libraries Overview
Siarhei Barysiuk
 
Dynamic memory allocation in c++
Dynamic memory allocation in c++Dynamic memory allocation in c++
Dynamic memory allocation in c++
Tech_MX
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
Matteo Battaglio
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
pragmamark
 
Objective runtime
Objective runtimeObjective runtime
Objective runtime
Michael Shieh
 
Dispatch in Clojure
Dispatch in ClojureDispatch in Clojure
Dispatch in Clojure
Carlo Sciolla
 

Similar to The messy lecture (20)

iOS Session-2
iOS Session-2iOS Session-2
iOS Session-2
 
Spring data
Spring dataSpring data
Spring data
 
Runtime
RuntimeRuntime
Runtime
 
iPhone Memory Management
iPhone Memory ManagementiPhone Memory Management
iPhone Memory Management
 
Declarative Name Binding and Scope Rules
Declarative Name Binding and Scope RulesDeclarative Name Binding and Scope Rules
Declarative Name Binding and Scope Rules
 
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legion
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legion«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legion
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legion
 
Defining classes-part-i-constructors-properties
Defining classes-part-i-constructors-propertiesDefining classes-part-i-constructors-properties
Defining classes-part-i-constructors-properties
 
Core java concepts
Core    java  conceptsCore    java  concepts
Core java concepts
 
Python lec4
Python lec4Python lec4
Python lec4
 
constructors and destructors
constructors and destructorsconstructors and destructors
constructors and destructors
 
Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code
Using Fuzzy Code Search to Link Code Fragments in Discussions to Source CodeUsing Fuzzy Code Search to Link Code Fragments in Discussions to Source Code
Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code
 
Getting Started with PL/Proxy
Getting Started with PL/ProxyGetting Started with PL/Proxy
Getting Started with PL/Proxy
 
Doctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperDoctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document Mapper
 
Blocks and GCD(Grand Central Dispatch)
Blocks and GCD(Grand Central Dispatch)Blocks and GCD(Grand Central Dispatch)
Blocks and GCD(Grand Central Dispatch)
 
JavaScript Libraries Overview
JavaScript Libraries OverviewJavaScript Libraries Overview
JavaScript Libraries Overview
 
Dynamic memory allocation in c++
Dynamic memory allocation in c++Dynamic memory allocation in c++
Dynamic memory allocation in c++
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
 
Objective runtime
Objective runtimeObjective runtime
Objective runtime
 
Dispatch in Clojure
Dispatch in ClojureDispatch in Clojure
Dispatch in Clojure
 

Recently uploaded

Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 

Recently uploaded (20)

Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 

The messy lecture

  • 1. РАЗХВЪРЛЯНАТА ПРЕЗЕНТАЦИЯ Около първи етаж след основите Thursday, December 22, 11
  • 2. DOT SYNTAX set (.) alternative to ([]) to invoke accessor methods get self.age = 10; // Each member of the path is an object. [self setAge:10]; x = person.address.street.name; x = [[[person address] street] name]; // The path contains a C struct. // This will crash if window is nil or -contentView returns nil. y = window.contentView.bounds.origin.y; y = [[window contentView] bounds].origin.y; // An example of using a setter. person.address.street.name = @"Oxford Road"; [[[person address] street] setName: @"Oxford Road"]; Thursday, December 22, 11
  • 3. CHAPTER 2 Defining a Class INSTANCE VARIABLES SCOPEFigure 2-‐1 illustrates the levels of scoping. Figure 2-1 The scope of instance variables (@package scope not shown) The class that declares the @private instance variable @protected A class that inherits the @public instance variable Unrelated code • default : @protected Thursday, December 22, 11
  • 4. INSTANCE VARIABLES SCOPE @interface Worker : NSObject { NSString *name; @private NSInteger age; NSString *evaluation; @protected id job; CGFloat wage; @public id boss; } Thursday, December 22, 11
  • 5. @property @property float value; @property(copy, readwrite) NSString *value; @synthesize = напищи ми getter & setter Access Memory Multithreaded environment (ARC) readwrite - default strong (owning) By default, accessors are atomic. readonly - only the getter method weak (non-owning) nonatomic returns the value directly (MRC) copy The previous value is sent a release message. NSCopying  protocol. assign default. NSInteger, CGRect.... retain upon assignment. The previous value is release-d Thursday, December 22, 11
  • 6. MEMORY MANAGEMENT Защо да създаваме обект: • запазване на instance variable • използване в метод Thursday, December 22, 11
  • 7. MEMORY MANAGEMENT Setter method - (void)setLastUpdatedDate:(NSDate *)newDate { ! if (newDate) { ! ! [lastUpdatedDate release]; ! ! lastUpdatedDate = [newDate retain]; } } //Recommended code: -(void) setName: (NSString *) theName {    [name release]    name = [[NSString alloc] initWthString: theName]; } //Incorrect code according to Kochan: -(void) setName: (NSString *) theName {    [name release]    name = [NSString stringWthString: theName]; } Thursday, December 22, 11
  • 8. MEMORY MANAGEMENT NSNumber* value1 = [[NSNumber alloc] initWithFloat:8.75]; [self setTotal:value1]; NSNumber* value2 = [NSNumber numberWithFloat:14.78]; [self setTotal:value2]; // only release value1 [value1 release]; Thursday, December 22, 11
  • 9. MESSAGES TO NIL [myArray release]; id anObjectMaybeNil = nil; myArray = nil; // this is valid if ([anObjectMaybeNil methodThatReturnsADouble] == 0.0) { // implementation continues... } Thursday, December 22, 11
  • 10. TTIMAGEVIEW UIImageView Name Link Title Note TTImageView Thursday, December 22, 11
  • 11. XCODE • NSString • .plist • [NSUserDefaults standardUserDefaults] • Custom UIImageView class Thursday, December 22, 11