<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tech Thought &#187; iPhone Development</title>
	<atom:link href="http://blog.evandavey.com/category/iphone-development/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.evandavey.com</link>
	<description>Tech tips, hints, and general musings. PHP, Perl, Mysql, Javascript, AJAX, JSON, Linux, Mac OSX</description>
	<lastBuildDate>Wed, 27 Apr 2011 03:56:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>How to Set Title of UITabBarItem Differently to UINavigationController title</title>
		<link>http://blog.evandavey.com/2010/09/how-to-set-title-of-uitabbaritem-differently-to-uinavigationcontroller-title.html</link>
		<comments>http://blog.evandavey.com/2010/09/how-to-set-title-of-uitabbaritem-differently-to-uinavigationcontroller-title.html#comments</comments>
		<pubDate>Fri, 10 Sep 2010 21:23:57 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[iPhone Development]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=661</guid>
		<description><![CDATA[A handy code snippet for doing as the title of the post says. Place this in the View Controller: - (void)awakeFromNib { self.navigationItem.title = @"My Long Navigation Item Title"; self.tabBarItem.title = @"Short Title"; [super awakeFromNib]; }]]></description>
			<content:encoded><![CDATA[<p>A handy code snippet for doing as the title of the post says.  Place this in the View Controller:<br />
<code><br />
- (void)awakeFromNib<br />
{<br />
        self.navigationItem.title = @"My Long Navigation Item Title";<br />
	self.tabBarItem.title = @"Short Title";</p>
<p>	[super awakeFromNib];<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2010/09/how-to-set-title-of-uitabbaritem-differently-to-uinavigationcontroller-title.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: iPhone SDK &#8211; Play and Record Audio concurrently</title>
		<link>http://blog.evandavey.com/2010/04/how-to-iphone-sdk-play-and-record-audio-concurrently.html</link>
		<comments>http://blog.evandavey.com/2010/04/how-to-iphone-sdk-play-and-record-audio-concurrently.html#comments</comments>
		<pubDate>Sun, 25 Apr 2010 02:06:49 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=635</guid>
		<description><![CDATA[Unfortunately, it&#8217;s quite a fiddly process to record audio and play it back at the same time on the iPhone.  By default, the sound output is very quiet from the iPhone&#8217;s speaker when you are recording sound.  So how do we fix this? First, setup your audio session to record audio: NSURL *url = [NSURL [...]]]></description>
			<content:encoded><![CDATA[<p>Unfortunately, it&#8217;s quite a fiddly process to record audio and play it back at the same time on the iPhone.  By default, the sound output is very quiet from the iPhone&#8217;s speaker when you are recording sound.  So how do we fix this?</p>
<p>First, setup your audio session to record audio:</p>
<pre>NSURL *url = [NSURL fileURLWithPath:@"/dev/null"];
NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
   [NSNumber numberWithFloat: 44100.0],                 AVSampleRateKey,
   [NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey,
   [NSNumber numberWithInt: 1],                         AVNumberOfChannelsKey,
   [NSNumber numberWithInt: AVAudioQualityMax],         AVEncoderAudioQualityKey, nil];

recorder = [[AVAudioRecorder alloc] initWithURL:url settings:settings error:&amp;error];
if (recorder) {
   [recorder prepareToRecord];
   recorder.meteringEnabled = YES;
   [recorder record];
} else {
   NSLog(@"Error: %@", error);
}
</pre>
<p>Then tell the device you want to record and play audio at the same time:</p>
<pre>AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = nil;
[audioSession setCategory :AVAudioSessionCategoryPlayAndRecord error:&amp;err];</pre>
<p>Then, and this is the key, allow the volume from the speakers to also be loud when recording:</p>
<pre>UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute,
sizeof(audioRouteOverride),&amp;audioRouteOverride);</pre>
<p>The end result?  You can happily play audio at full volume while recording from the device&#8217;s microphone.  Happy days.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2010/04/how-to-iphone-sdk-play-and-record-audio-concurrently.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How-To: Convert UIImage to Greyscale Equivalent</title>
		<link>http://blog.evandavey.com/2009/09/how-to-convert-uiimage-to-greyscale-equivalent.html</link>
		<comments>http://blog.evandavey.com/2009/09/how-to-convert-uiimage-to-greyscale-equivalent.html#comments</comments>
		<pubDate>Mon, 28 Sep 2009 02:32:41 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[greyscale]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[UIImage]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=564</guid>
		<description><![CDATA[Here&#8217;s a simple code snippet for converting a UIImage to a greyscale equivalent: -(UIImage *) convertToGreyscale:(UIImage *)i { int kRed = 1; int kGreen = 2; int kBlue = 4; int colors = kGreen; int m_width = i.size.width; int m_height = i.size.height; uint32_t *rgbImage = (uint32_t *) malloc(m_width * m_height * sizeof(uint32_t)); CGColorSpaceRef colorSpace = [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple code snippet for converting a UIImage to a greyscale equivalent:</p>
<pre>
-(UIImage *) convertToGreyscale:(UIImage *)i {

    int kRed = 1;
    int kGreen = 2;
    int kBlue = 4;

    int colors = kGreen;
    int m_width = i.size.width;
    int m_height = i.size.height;

    uint32_t *rgbImage = (uint32_t *) malloc(m_width * m_height * sizeof(uint32_t));
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    CGContextRef context = CGBitmapContextCreate(rgbImage, m_width, m_height, 8, m_width * 4, colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipLast);
    CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
    CGContextSetShouldAntialias(context, NO);
    CGContextDrawImage(context, CGRectMake(0, 0, m_width, m_height), [i CGImage]);
    CGContextRelease(context);
    CGColorSpaceRelease(colorSpace);

    // now convert to grayscale
    uint8_t *m_imageData = (uint8_t *) malloc(m_width * m_height);
    for(int y = 0; y < m_height; y++) {
        for(int x = 0; x < m_width; x++) {
			uint32_t rgbPixel=rgbImage[y*m_width+x];
			uint32_t sum=0,count=0;
			if (colors &#038; kRed) {sum += (rgbPixel>>24)&#038;255; count++;}
			if (colors &#038; kGreen) {sum += (rgbPixel>>16)&#038;255; count++;}
			if (colors &#038; kBlue) {sum += (rgbPixel>>8)&#038;255; count++;}
			m_imageData[y*m_width+x]=sum/count;
        }
    }
    free(rgbImage);

    // convert from a gray scale image back into a UIImage
    uint8_t *result = (uint8_t *) calloc(m_width * m_height *sizeof(uint32_t), 1);

    // process the image back to rgb
    for(int i = 0; i < m_height * m_width; i++) {
        result[i*4]=0;
        int val=m_imageData[i];
        result[i*4+1]=val;
        result[i*4+2]=val;
        result[i*4+3]=val;
    }

    // create a UIImage
    colorSpace = CGColorSpaceCreateDeviceRGB();
    context = CGBitmapContextCreate(result, m_width, m_height, 8, m_width * sizeof(uint32_t), colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipLast);
    CGImageRef image = CGBitmapContextCreateImage(context);
    CGContextRelease(context);
    CGColorSpaceRelease(colorSpace);
    UIImage *resultUIImage = [UIImage imageWithCGImage:image];
    CGImageRelease(image);

    // make sure the data will be released by giving it to an autoreleased NSData
    [NSData dataWithBytesNoCopy:result length:m_width * m_height];

    return resultUIImage;
}
</pre>
<p>Thanks to the friendly people at <a href="http://stackoverflow.com/questions/1298867/convert-image-to-grayscale">StackOverflow.com</a> for this snipet.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2009/09/how-to-convert-uiimage-to-greyscale-equivalent.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What does iPhone OS 3.0 Mean for your Apps?</title>
		<link>http://blog.evandavey.com/2009/08/what-does-iphone-os-3-0-mean-for-your-apps.html</link>
		<comments>http://blog.evandavey.com/2009/08/what-does-iphone-os-3-0-mean-for-your-apps.html#comments</comments>
		<pubDate>Thu, 27 Aug 2009 22:15:15 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=549</guid>
		<description><![CDATA[Recently I was involved in a podcast regarding the iPhone OS 3.0 upgrade. We looked at all the new features (and some upcoming ones in v3.1) and discussed how they relate to new features clients can develop in their apps. You can hear more here: What does iPhone OS 3.0 Mean for Your Apps (WSP [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was involved in a podcast regarding the iPhone OS 3.0 upgrade.  We looked at all the new features (and some upcoming ones in v3.1) and discussed how they relate to new features clients can develop in their apps.  </p>
<p>You can hear more here:</p>
<p><a href="http://wspeonline.com/news/140-what-does-the-iphone-os-30-upgrade-mean-for-your-apps.html">What does iPhone OS 3.0 Mean for Your Apps (WSP Online)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2009/08/what-does-iphone-os-3-0-mean-for-your-apps.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How-To: Convert NSData to NSString</title>
		<link>http://blog.evandavey.com/2009/07/how-to-convert-nsdata-to-nsstring.html</link>
		<comments>http://blog.evandavey.com/2009/07/how-to-convert-nsdata-to-nsstring.html#comments</comments>
		<pubDate>Thu, 16 Jul 2009 00:44:03 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=542</guid>
		<description><![CDATA[How do you convert an NSData object into it&#8217;s string representation?  Should be easy, right?  It is, when you know how&#8230; NSString* theString = [[NSString alloc] initWithData:theData encoding:NSASCIIStringEncoding];]]></description>
			<content:encoded><![CDATA[<p>How do you convert an NSData object into it&#8217;s string representation?  Should be easy, right?  It is, when you know how&#8230;</p>
<pre><tt>NSString* theString = [[NSString alloc] initWithData:theData encoding:NSASCIIStringEncoding];</tt></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2009/07/how-to-convert-nsdata-to-nsstring.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How-To: Detect when MKAnnotation, MKAnnotationView is selected</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html</link>
		<comments>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html#comments</comments>
		<pubDate>Mon, 13 Jul 2009 00:24:05 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[MapKit]]></category>
		<category><![CDATA[MKAnnotation]]></category>
		<category><![CDATA[MKAnnotationView]]></category>
		<category><![CDATA[MKMapView]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=533</guid>
		<description><![CDATA[I&#8217;m using MapKit to display a satellite map in one of my apps.  I create custom annotations &#8211; and it all works great.  However I wanted to be able to play sounds when a user touches one of my MKAnnotation&#8217;s on my MapKit MKMapView so that the sound matches the display of the callout (and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using MapKit to display a satellite map in one of my apps.  I create custom annotations &#8211; and it all works great.  However I wanted to be able to play sounds when a user touches one of my MKAnnotation&#8217;s on my MapKit MKMapView so that the sound matches the display of the callout (and when it disappears too).</p>
<p>There is no delegate method or other built-in mechanism for detecting when your annotation is selected, however it does have a selected property.  So how to detect when the MKAnnotation is selected and then play my sounds?  The answer is key/value observing.</p>
<p>Setup an observer on our imageAnnontationView:</p>
<pre>// At the top of the .m file put:
static NSString* const GMAP_ANNOTATION_SELECTED = @"gMapAnnontationSelected";</pre>
<pre>// Then later somewhere in your code, add the observer
[imageAnnotationView addObserver:self
		 forKeyPath:@"selected"
		options:NSKeyValueObservingOptionNew
		context:GMAP_ANNOTATION_SELECTED];</pre>
<p>Then we get a callback whenever the selected property of our annotation changes:</p>
<pre>- (void)observeValueForKeyPath:(NSString *)keyPath
                      ofObject:(id)object
                        change:(NSDictionary *)change
                       context:(void *)context{

    NSString *action = (NSString*)context;

    if([action isEqualToString:GMAP_ANNOTATION_SELECTED]){
      BOOL annotationAppeared = [[change valueForKey:@"new"] boolValue];
     // do something
   }
}</pre>
<p>The value of annotationAppeared will change based on the state of the annontations selected property.  GMAP_ANOTATION_SELECTED is a constant string I set at the top of my file.</p>
<p>I&#8217;ve updated my post to make the GMAP_ANOTATION_SELECTED constant more obvious.  Hopefully this helps people use the snippet above.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>How-To: Detect if users have turned off the iPhone GPS</title>
		<link>http://blog.evandavey.com/2009/04/how-to-detect-if-users-have-turned-off-the-iphone-gps.html</link>
		<comments>http://blog.evandavey.com/2009/04/how-to-detect-if-users-have-turned-off-the-iphone-gps.html#comments</comments>
		<pubDate>Wed, 29 Apr 2009 22:43:56 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=475</guid>
		<description><![CDATA[Simple and common situation.  You have an app that needs to use the GPS to function correctly.  However, users have the last say in this and can simply say &#8220;No&#8221; when the iPhone asks them if your application asks to turn on the GPS.  If you don&#8217;t deal with this situation, then it&#8217;s likely that [...]]]></description>
			<content:encoded><![CDATA[<p>Simple and common situation.  You have an app that needs to use the GPS to function correctly.  However, users have the last say in this and can simply say &#8220;No&#8221; when the iPhone asks them if your application asks to turn on the GPS.  If you don&#8217;t deal with this situation, then it&#8217;s likely that Apple will reject your application.</p>
<p>So what to do?  Simple, implement the following CLLocationManager delegate method:</p>
<pre>- (void)locationManager:(CLLocationManager *)manager
       didFailWithError:(NSError *)error</pre>
<p>Inside this method, make sure you deal with not receiving any GPS locations in a sensible manner (show a popup, skip etc).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2009/04/how-to-detect-if-users-have-turned-off-the-iphone-gps.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A solution to: Application failed codesign verification</title>
		<link>http://blog.evandavey.com/2009/04/a-solution-to-application-failed-codesign-verification.html</link>
		<comments>http://blog.evandavey.com/2009/04/a-solution-to-application-failed-codesign-verification.html#comments</comments>
		<pubDate>Wed, 29 Apr 2009 22:40:28 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[app submission]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=473</guid>
		<description><![CDATA[Okay, so you&#8217;ve spent months working hard on your iPhone project, and you finally go gold.  You get sign off from your client, you&#8217;ve squashed the last of your bugs and you think &#8220;I&#8217;m ready to submit this bad boy!&#8221;.  You package it up for release as per Apple&#8217;s instructions, and then try and upload [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so you&#8217;ve spent months working hard on your iPhone project, and you finally go gold.  You get sign off from your client, you&#8217;ve squashed the last of your bugs and you think &#8220;I&#8217;m ready to submit this bad boy!&#8221;.  You package it up for release as per Apple&#8217;s instructions, and then try and upload it using the <a href="http://iphonedevelopertips.com/tools/application-loader.html" target="_blank">Application Loader</a> that Apple supplies.</p>
<p><span id="more-473"></span></p>
<p>Then you get a message from the Application Loader:</p>
<p><em>Application failed codesign verification. </em></p>
<p><em></em>What the??  If you check the activity log you also see the following:</p>
<p><em>A sealed resource is missing or invalid</em></p>
<p>After countless hours trawling Google and finding nothing, I worked out that I needed to do two things:</p>
<ol>
<li>Remove all files from the project that started with ._ (dot then underscore).  See my <a href="http://blog.evandavey.com/2008/05/removing-mac-_-files-on-linux.html">previous post</a> for more, however you just open the terminal and run <strong>find . -name &#8220;._*&#8221; -print0 | xargs -0 rm -rf </strong>from the command line in the root of the project</li>
<li>Make sure that the Icon File setting in the info.plist file is empty</li>
</ol>
<p>After making these two changes, and rebuilding my project (make sure you do a &#8220;clean all&#8221;) it submitted to Apple without problem.  I really hope that helps someone&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2009/04/a-solution-to-application-failed-codesign-verification.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How-To: Remove grey shadow from iPhone UIWebView</title>
		<link>http://blog.evandavey.com/2009/03/how-to-remove-grey-shadow-from-iphone-uiwebview.html</link>
		<comments>http://blog.evandavey.com/2009/03/how-to-remove-grey-shadow-from-iphone-uiwebview.html#comments</comments>
		<pubDate>Fri, 27 Mar 2009 03:57:59 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[iPhone web]]></category>
		<category><![CDATA[UIWebView]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=458</guid>
		<description><![CDATA[By default, when you create a clickable HTML element in a webpage (or in HTML that is displayed in a UIWebView) the iPhone adds a grey shadow/box thing over the top of it when you touch it. Sometimes you don&#8217;t want this &#8216;highlight&#8217; to appear &#8211; or you want it to be another color.  Here [...]]]></description>
			<content:encoded><![CDATA[<p>By default, when you create a clickable HTML element in a webpage (or in HTML that is displayed in a UIWebView) the iPhone adds a grey shadow/box thing over the top of it when you touch it.</p>
<p>Sometimes you don&#8217;t want this &#8216;highlight&#8217; to appear &#8211; or you want it to be another color.  Here is the code that will help you in this situation:</p>
<p><strong>Remove the grey highlight completely: </strong></p>
<pre>-webkit-tap-highlight-color:rgba(<span>0</span>,<span>0</span>,<span>0</span>,<span>0</span>);</pre>
<p><strong>Change the color of the highlight:</strong></p>
<pre>-webkit-tap-highlight-color:your-color-here;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2009/03/how-to-remove-grey-shadow-from-iphone-uiwebview.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How-To: Solve &#8216;modifying layer that is being finalized&#8217; iPhone SDK</title>
		<link>http://blog.evandavey.com/2009/03/how-to-solve-modifying-layer-that-is-being-finalized-iphone-sdk.html</link>
		<comments>http://blog.evandavey.com/2009/03/how-to-solve-modifying-layer-that-is-being-finalized-iphone-sdk.html#comments</comments>
		<pubDate>Wed, 18 Mar 2009 04:00:41 +0000</pubDate>
		<dc:creator>Ev</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://blog.evandavey.com/?p=445</guid>
		<description><![CDATA[Okay, so I&#8217;ve been getting the &#8216;modifying layer that is being finalized&#8217; error message when i&#8217;m trying to release a subview from a superview: [self.popupPreviewView release]; self.popupPreviewView = nil; The best way to solve this (that I&#8217;ve found &#8211; please post a comment if you can provide a better one) is to remove the view [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so I&#8217;ve been getting the &#8216;<em><strong><span style="font-style: normal;">modifying layer that is being finalized&#8217;</span></strong> </em>error message when i&#8217;m trying to release a subview from a superview:</p>
<pre>[self.popupPreviewView release];
self.popupPreviewView = nil;</pre>
<p>The best way to solve this (that I&#8217;ve found &#8211; please post a comment if you can provide a better one) is to remove the view from it&#8217;s superview rather than release it:</p>
<pre>[self.popupPreviewView removeFromSuperview];
self.popupPreviewView = nil;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.evandavey.com/2009/03/how-to-solve-modifying-layer-that-is-being-finalized-iphone-sdk.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

