On the iPhone, I would like to do some operations on the image in a separate stream. Instead of dealing with half-holes, locking, etc., I would like to use the "One Object, One Thread" method, which safely records this parallel operation. I'm not sure if this is the right way to copy my object to a new stream so that the object is not available in the main stream. Use the copy method? If so, am I doing this before the stream or inside the stream?
... -(void)someMethod{ UIImage *myImage; [NSThread detachNewThreadSelector:@selector(getRotatedImage:) toTarget:self withObject:myImage]; } -(void)getRotatedImage:(UIImage *)image{ ... ... UIImage *copiedImage = [image copy]; ... ... }
, .
enter scope create object pass the object to the processing thread start the processing thread exist scope // the object is no longer visible/used/referenced
: , , , , , ... , . , .
Update:... - , getRotatedImage, . . , , , .
getRotatedImage
, - - , - , .
.
Source: https://habr.com/ru/post/1736595/More articles:Having a different action for each button dynamically created in a loop - javaEnsuring that the WPF window is on top all the time, even when the user clicks on another application with maximum impact - winapiΠΠ°ΠΊ ΠΈΠ·ΠΌΠ΅ΡΡΡΡ ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΠ΅Π»ΡΠ½ΠΎΡΡΡ Π²Π΅Π±-ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ? - performanceHow to get two-way work binding for asp.net nested repeater controls - asp.netPython help () function and string.title function - pythonHow can I indicate which type of relationship to use as a function of the current node at each step of the traversal with neo4j? - neo4j.NET Active Directory Expiration on Windows 2008 - c #ΠΠ΄Π½ΠΎΠ²ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ ΡΠ·ΡΠΊΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π΄Π»Ρ ΡΠ°ΡΠ° ΠΈ ΠΏΠΎΠ΄ΠΎΠ±Π½ΡΡ Twitter-ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ - scalaHow to use the built-in functions of V8 - c ++How to find website root path from dll? - c #All Articles