<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: lichuange</title>
    <description>The latest articles on DEV Community by lichuange (@jacoli).</description>
    <link>https://dev.to/jacoli</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1324598%2Ff42114db-5722-4788-bf60-43708e9c2f98.jpeg</url>
      <title>DEV Community: lichuange</title>
      <link>https://dev.to/jacoli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jacoli"/>
    <language>en</language>
    <item>
      <title>Instruments15.3(From XCode15.4)Can't find source code for selected symbol</title>
      <dc:creator>lichuange</dc:creator>
      <pubDate>Thu, 18 Jul 2024 11:46:35 +0000</pubDate>
      <link>https://dev.to/jacoli/instruments153from-xcode154cant-find-source-code-for-selected-symbol-ob0</link>
      <guid>https://dev.to/jacoli/instruments153from-xcode154cant-find-source-code-for-selected-symbol-ob0</guid>
      <description>&lt;p&gt;Recently i have meet the issue that &lt;code&gt;Can't find source code for selected symbol&lt;/code&gt; in XCode instruments with version 15.3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My environment:&lt;/strong&gt;&lt;br&gt;
Mac: MacBook Pro(Apple M3 Pro), MacOS Sonoma Version 14.2.1&lt;br&gt;
XCode: 15.4&lt;br&gt;
Instrument: 15.3 within the Xcode&lt;/p&gt;

&lt;h3&gt;
  
  
  The problem is showed as below
&lt;/h3&gt;

&lt;p&gt;If choose Recording Mode with Last&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fingjpqb0bgutbosp6a6e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fingjpqb0bgutbosp6a6e.png" alt="Image description" width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;there will be the issue 'Can't find source code for selected symbol',&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdymi1junjkcycx70o7k4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdymi1junjkcycx70o7k4.png" alt="Image description" width="800" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and the paths of system frameworks are located at '/System/Library/PrivateFrameworks/...' which are for MacOS not for iOS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9r041alf7ojw10sp07oc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9r041alf7ojw10sp07oc.png" alt="Image description" width="800" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Some tries to solve the problem
&lt;/h3&gt;

&lt;p&gt;If choose Recording Mode with Deferred,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvoyx0m5jgeubf9vegk3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvoyx0m5jgeubf9vegk3.png" alt="Image description" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;symbols can be resolved and the frameworks paths are all correct at '/Users/xxx/Library/Developer/Xcode/iOS DeviceSupport/iPhone13,2 17.5.1 (21F90)/Symbols/System/Library/PrivateFrameworks/...'.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frszhpxrnr8jhvyw38n0j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frszhpxrnr8jhvyw38n0j.png" alt="Image description" width="800" height="668"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;As result, I think this is a bug of XCode instruments, expecting fixed in the following version.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Testing UICollectionViewCell reuse behavior</title>
      <dc:creator>lichuange</dc:creator>
      <pubDate>Fri, 08 Mar 2024 03:33:46 +0000</pubDate>
      <link>https://dev.to/jacoli/testing-uicollectionviewcell-reuse-behavior-26n3</link>
      <guid>https://dev.to/jacoli/testing-uicollectionviewcell-reuse-behavior-26n3</guid>
      <description>&lt;p&gt;The behavior of reusing UICollectionViewCell while reload UICollectionView is diverse.&lt;/p&gt;

&lt;p&gt;Here gives some cases to test the result.&lt;/p&gt;

&lt;h3&gt;
  
  
  Case1: Call the method &lt;code&gt;reloadData&lt;/code&gt; directly
&lt;/h3&gt;

&lt;p&gt;eg.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[self.collectionView reloadData];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result: &lt;br&gt;
All cells are recycled and reused in an unordered manner, without any animation.&lt;/p&gt;
&lt;h3&gt;
  
  
  Case2: Call the method &lt;code&gt;reloadData&lt;/code&gt; inside &lt;code&gt;performBatchUpdates&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;eg.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[self.collectionViewperformBatchUpdates:^{
   [self.collectionView reloadData];
} completion:^(BOOL finished) {
}];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
The method &lt;code&gt;cellForItemAtIndexPath&lt;/code&gt; is not invoked, and no cells are recycled or reused, but with animation.&lt;/p&gt;
&lt;h3&gt;
  
  
  Case3: Call the method &lt;code&gt;reloadItemsAtIndexPaths&lt;/code&gt; directly
&lt;/h3&gt;

&lt;p&gt;eg.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForRow:btn.tag inSection:0]]];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result: &lt;br&gt;
The method &lt;code&gt;cellForItemAtIndexPath&lt;/code&gt; is called for the current row, where a new cell is created and applied, while the old one is recycled to reuse pool, with animation.&lt;/p&gt;
&lt;h3&gt;
  
  
  Case4: Call the method &lt;code&gt;reloadItemsAtIndexPaths&lt;/code&gt; inside &lt;code&gt;performBatchUpdates&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;eg.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[self.collectionViewperformBatchUpdates:^{
    [self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPathindexPathForRow:btn.taginSection:0]]];
} completion:^(BOOL finished) {
}];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result: &lt;br&gt;
Same as Case3, the method &lt;code&gt;cellForItemAtIndexPath&lt;/code&gt; is called for the current row, where a new cell is created and applied, while the old one is recycled to reuse pool, with animation.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
