Submit Search
Upload
block introduce
•
Download as KEY, PDF
•
0 likes
•
265 views
B
bang590
Follow
object-c block introduce
Read less
Read more
Business
Technology
Report
Share
Report
Share
1 of 18
Download now
Recommended
Block introduce
Block introduce
bang590
completion_proc and history
completion_proc and history
Nobuhiro IMAI
Groovify your java code by hervé roussel
Groovify your java code by hervé roussel
Hervé Vũ Roussel
MFC Message Handling
MFC Message Handling
Janani Anbarasan
C++ idioms.pptx
C++ idioms.pptx
Janani Anbarasan
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovy
Yasuharu Nakano
Отладка в GDB
Отладка в GDB
Anthony Shoumikhin
为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?
勇浩 赖
Recommended
Block introduce
Block introduce
bang590
completion_proc and history
completion_proc and history
Nobuhiro IMAI
Groovify your java code by hervé roussel
Groovify your java code by hervé roussel
Hervé Vũ Roussel
MFC Message Handling
MFC Message Handling
Janani Anbarasan
C++ idioms.pptx
C++ idioms.pptx
Janani Anbarasan
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovy
Yasuharu Nakano
Отладка в GDB
Отладка в GDB
Anthony Shoumikhin
为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?
勇浩 赖
JavaScript - Agora nervoso
JavaScript - Agora nervoso
Luis Vendrame
Empty Base Class Optimisation, [[no_unique_address]] and other C++20 Attributes
Empty Base Class Optimisation, [[no_unique_address]] and other C++20 Attributes
Bartlomiej Filipek
Textile
Textile
Vanessa Lošić
Singly Linked List
Singly Linked List
Er. Ganesh Ram Suwal
CodiLime Tech Talk - Grzegorz Rozdzialik: What the java script
CodiLime Tech Talk - Grzegorz Rozdzialik: What the java script
CodiLime
1
1
swetha gokavarapu
Code
Code
Lay Chan Dara Raksmey
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
Markus Schneider
A few words about OpenSSL
A few words about OpenSSL
PVS-Studio
Node intro
Node intro
cloudhead
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
Alfonso Peletier
C++ Programming - 3rd Study
C++ Programming - 3rd Study
Chris Ohk
Tugas Program C++
Tugas Program C++
Reynes E. Tekay
Flashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas Mac
ESET Latinoamérica
Hachiojipm11
Hachiojipm11
Hideaki Ohno
2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english
Jen Yee Hong
Mastering advanced concepts in Silverlight
Mastering advanced concepts in Silverlight
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
Knee-deep in C++ s... code
Knee-deep in C++ s... code
PVS-Studio
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 Autumn
Moriyoshi Koizumi
Rcpp11
Rcpp11
Romain Francois
Double Vision21
Double Vision21
guestd7e41f3
36 Holes
36 Holes
guestd7e41f3
More Related Content
What's hot
JavaScript - Agora nervoso
JavaScript - Agora nervoso
Luis Vendrame
Empty Base Class Optimisation, [[no_unique_address]] and other C++20 Attributes
Empty Base Class Optimisation, [[no_unique_address]] and other C++20 Attributes
Bartlomiej Filipek
Textile
Textile
Vanessa Lošić
Singly Linked List
Singly Linked List
Er. Ganesh Ram Suwal
CodiLime Tech Talk - Grzegorz Rozdzialik: What the java script
CodiLime Tech Talk - Grzegorz Rozdzialik: What the java script
CodiLime
1
1
swetha gokavarapu
Code
Code
Lay Chan Dara Raksmey
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
Markus Schneider
A few words about OpenSSL
A few words about OpenSSL
PVS-Studio
Node intro
Node intro
cloudhead
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
Alfonso Peletier
C++ Programming - 3rd Study
C++ Programming - 3rd Study
Chris Ohk
Tugas Program C++
Tugas Program C++
Reynes E. Tekay
Flashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas Mac
ESET Latinoamérica
Hachiojipm11
Hachiojipm11
Hideaki Ohno
2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english
Jen Yee Hong
Mastering advanced concepts in Silverlight
Mastering advanced concepts in Silverlight
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
Knee-deep in C++ s... code
Knee-deep in C++ s... code
PVS-Studio
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 Autumn
Moriyoshi Koizumi
Rcpp11
Rcpp11
Romain Francois
What's hot
(20)
JavaScript - Agora nervoso
JavaScript - Agora nervoso
Empty Base Class Optimisation, [[no_unique_address]] and other C++20 Attributes
Empty Base Class Optimisation, [[no_unique_address]] and other C++20 Attributes
Textile
Textile
Singly Linked List
Singly Linked List
CodiLime Tech Talk - Grzegorz Rozdzialik: What the java script
CodiLime Tech Talk - Grzegorz Rozdzialik: What the java script
1
1
Code
Code
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
A few words about OpenSSL
A few words about OpenSSL
Node intro
Node intro
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
C++ Programming - 3rd Study
C++ Programming - 3rd Study
Tugas Program C++
Tugas Program C++
Flashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas Mac
Hachiojipm11
Hachiojipm11
2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english
Mastering advanced concepts in Silverlight
Mastering advanced concepts in Silverlight
Knee-deep in C++ s... code
Knee-deep in C++ s... code
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 Autumn
Rcpp11
Rcpp11
Viewers also liked
Double Vision21
Double Vision21
guestd7e41f3
36 Holes
36 Holes
guestd7e41f3
ORU Outreach Support Brochure
ORU Outreach Support Brochure
Susan Vincent
无线代码库开发分享
无线代码库开发分享
bang590
Interviewing Skills
Interviewing Skills
Emily Roh
Es esto-arte-100177
Es esto-arte-100177
deyamira Ormeño
Hot hot hot check ‘em out!
Hot hot hot check ‘em out!
Tehoward44
Prevention of Heart attack, Stroke, Myocardial infarction.Our method
Prevention of Heart attack, Stroke, Myocardial infarction.Our method
Cardiovascularprevention
lexiko-orwn
lexiko-orwn
eirinips
Viewers also liked
(9)
Double Vision21
Double Vision21
36 Holes
36 Holes
ORU Outreach Support Brochure
ORU Outreach Support Brochure
无线代码库开发分享
无线代码库开发分享
Interviewing Skills
Interviewing Skills
Es esto-arte-100177
Es esto-arte-100177
Hot hot hot check ‘em out!
Hot hot hot check ‘em out!
Prevention of Heart attack, Stroke, Myocardial infarction.Our method
Prevention of Heart attack, Stroke, Myocardial infarction.Our method
lexiko-orwn
lexiko-orwn
Similar to block introduce
iOS Development with Blocks
iOS Development with Blocks
Jeff Kelley
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)
AvitoTech
Blocks and GCD(Grand Central Dispatch)
Blocks and GCD(Grand Central Dispatch)
Jigar Maheshwari
Objective C Block
Objective C Block
Fantageek
A JIT Smalltalk VM written in itself
A JIT Smalltalk VM written in itself
ESUG
Blocks & GCD
Blocks & GCD
rsebbe
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」
matuura_core
Objective-Cひとめぐり
Objective-Cひとめぐり
Kenji Kinukawa
Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516
SOAT
Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113
SOAT
ARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマー
Satoshi Asano
Agile Iphone Development
Agile Iphone Development
Giordano Scalzo
[A 3]Javascript oop for xpages developers - public
[A 3]Javascript oop for xpages developers - public
Kazunori Tatsuki
Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)
David Atchley
OPL best practices - Doing more with less easier
OPL best practices - Doing more with less easier
Alex Fleischer
Security and Encryption on iOS
Security and Encryption on iOS
Graham Lee
JavaScript for PHP developers
JavaScript for PHP developers
Stoyan Stefanov
A Practitioner’s guide to Hardened JavaScript
A Practitioner’s guide to Hardened JavaScript
Tom Van Cutsem
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
akaptur
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Sarp Erdag
Similar to block introduce
(20)
iOS Development with Blocks
iOS Development with Blocks
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)
Blocks and GCD(Grand Central Dispatch)
Blocks and GCD(Grand Central Dispatch)
Objective C Block
Objective C Block
A JIT Smalltalk VM written in itself
A JIT Smalltalk VM written in itself
Blocks & GCD
Blocks & GCD
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」
Objective-Cひとめぐり
Objective-Cひとめぐり
Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516
Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113
ARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマー
Agile Iphone Development
Agile Iphone Development
[A 3]Javascript oop for xpages developers - public
[A 3]Javascript oop for xpages developers - public
Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)
OPL best practices - Doing more with less easier
OPL best practices - Doing more with less easier
Security and Encryption on iOS
Security and Encryption on iOS
JavaScript for PHP developers
JavaScript for PHP developers
A Practitioner’s guide to Hardened JavaScript
A Practitioner’s guide to Hardened JavaScript
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Recently uploaded
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
Abortion pills in Kuwait Cytotec pills in Kuwait
Organizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
Seta Wicaksana
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon investment
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
dlhescort
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Seo
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
IndeedSEO
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
dollysharma2066
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Anamikakaur10
Eluru Call Girls Service ☎ ️93326-06886 ❤️🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️🔥 Enjoy 24/7 Escort Service
Damini Dixit
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
allensay1
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
P&CO
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation Final
PanhandleOilandGas
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
daisycvs
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)- A new venture concept
P&CO
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
Aggregage
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
Call Girls in Nagpur High Profile Call Girls
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
kapoorjyoti4444
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Sheetaleventcompany
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Admir Softic
Recently uploaded
(20)
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
Organizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business Potential
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Eluru Call Girls Service ☎ ️93326-06886 ❤️🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️🔥 Enjoy 24/7 Escort Service
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation Final
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)- A new venture concept
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
block introduce
1.
Block特性 bangchen
2.
block在栈创建
3.
4.
typedef int(^Blocky)(void); Blocky b[3]; for
(int i=0; i<3; i++) b[i] = ^{ return i;}; for (int i=0; i<3; i++) printf("b %dn", b[i]());
5.
block copy • 我们用到的callback/GCD都是copy •
第一次copy,block放入堆里 • 用到的值变量 制一份 • 引用到的所有对象reatainCount+1
6.
7.
8.
__block
9.
把变量放入堆,指向同一个地址 typedef void(^Blocky)(void);
Blocky b; int i = 0; b = ^{ NSLog(@"i %d", i); }; i ++; b(); //0 typedef void(^Blocky)(void); Blocky b; __block int i = 0; b = ^{ NSLog(@"i %d", i); }; i ++; b(); //1
10.
可修改 id x;
__block id y; __block BOOL isRuned = NO; void (^block)(void) =^{ x = [NSString string]; // error y = [NSString string]; // works isRuned = YES; //works };
11.
递归调用block typedef int(^Blocky)(int
i); __block Blocky b = ^(int i){ if (i == 0 || i == 1) return i; return b(i-1) + b(i-2); }; NSLog(@"%d", b(10));
12.
循环引用
13.
问题
[self setCompletionBlock:^{ NSLog(@"%@", self.error); }]; self retainCount + 1 self keep completeBlock - (void)setCompletionBlock:(ASIBasicBlock)aCompletionBlock { ! [completionBlock release]; ! completionBlock = [aCompletionBlock copy]; } self retain completionBlock, complationBlock retain self
14.
解决(without ARC) __block
id that = self; [self setCompletionBlock:^{ NSLog(@"%@", that.error); }]; or NSString *err = self.error; [self setCompletionBlock:^{ NSLog(@"%@", err); }];
15.
解决(with ARC) iOS5:
__weak id that = self; [self setCompletionBlock:^{ NSLog(@"%@", that.error); }]; iOS4/5: __unsafe_unretained id that = self; [self setCompletionBlock:^{ NSLog(@"%@", that.error); }];
16.
不易发现的循环引用 ViewController* settingsViewController =
[[[ViewController alloc] init] autorelease]; settingsViewController.onUpdate = ^{ [self doUpdate]; } self.settingsViewController = settingsViewController;
17.
18.
END
Editor's Notes
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Download now