<?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>Aaron Jefferson Villanueva&#039;s Blog Site&#187; Xcode</title>
	<atom:link href="http://malebolgia.shadowsonawall.net/tag/xcode/feed" rel="self" type="application/rss+xml" />
	<link>http://malebolgia.shadowsonawall.net</link>
	<description>Programming / Designing Blogging from windows to mac.</description>
	<lastBuildDate>Fri, 20 May 2011 12:05:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PhoneGap Copy Javascript Error</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/phonegap-copy-javascript-error.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/phonegap-copy-javascript-error.html#comments</comments>
		<pubDate>Mon, 16 May 2011 07:20:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Objective C / Cocoa Touch [iPhone]]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=514</guid>
		<description><![CDATA[I'm trying something new right now, web apps on smartphones, while trying to shell a simple html I did, (just displaying a JS alert box) I got this error that phoneGap can't transfer something.









The simple fixed was just rename the folder that has space on it going to your xcode project.



]]></description>
			<content:encoded><![CDATA[I'm trying something new right now, web apps on smartphones, while trying to shell a simple html I did, (just displaying a JS alert box) I got this error that phoneGap can't transfer something.

<br /><br />

<a title="PhoneGap JS Debug" rel="rokzoom[PhoneGap JS Debug]" href="http://malebolgia.shadowsonawall.net/images/PhoneGap/PhoneGapNamingConvention.jpg">
<img title="PhoneGap JS Debug" src="http://malebolgia.shadowsonawall.net/images/PhoneGap/PhoneGapSmall.png" alt="PhoneGap JS Debug"  border="0"   />
</a>

<br /><br />

The simple fixed was just rename the folder that has space on it going to your xcode project.

<br /><br />

<img title="PhoneGap JS Test" src="http://malebolgia.shadowsonawall.net/images/PhoneGap/phoneGapTest.jpg" alt="PhoneGap JS Test"  border="0"   />]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/phonegap-copy-javascript-error.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="1" length="" type="" />
		</item>
		<item>
		<title>NSConcreteMutableData</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/objective-c-cocoa-touch-iphone/nsconcretemutabledata.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/objective-c-cocoa-touch-iphone/nsconcretemutabledata.html#comments</comments>
		<pubDate>Fri, 09 Jul 2010 15:55:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Objective C / Cocoa Touch [iPhone]]]></category>
		<category><![CDATA[instruments]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Memory Leak]]></category>
		<category><![CDATA[NSConcreteMutableData]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=342</guid>
		<description><![CDATA[
For some reason I experienced another odd memory leak and I'm not sure what causing it, when I try to access one of my view controllers.





The thing was... I mistakenly selected "Simulator 3.0" which the bug exists.




Apple already fixed this issue with 3.1.  

Under "Known Issues and Fixes/Core Data" 

"The memory leak of an [...]]]></description>
			<content:encoded><![CDATA[
For some reason I experienced another odd memory leak and I'm not sure what causing it, when I try to access one of my view controllers.
<br /><br />
<a title="NSConcreteMutableData Memory Leak" rel="rokzoom[nsconcrete]" href="http://malebolgia.shadowsonawall.net/images/xcode/NSConcreteMutableData/NSConcreteMutableData_medium.png">
<img title="NSConcreteMutableData" src="http://malebolgia.shadowsonawall.net/images/xcode/NSConcreteMutableData/NSConcreteMutableData_small.png" alt="NSConcreteMutableData" width="293" height="59"  border="0"   />
</a>
<br /><br />
The thing was... I mistakenly selected "Simulator 3.0" which the bug exists.
<br /><br />
<img title="Simulator 3.0" src="http://malebolgia.shadowsonawall.net/images/xcode/NSConcreteMutableData/simulator.png" alt="Simulator 3.0" width="282" height="36"  border="0"   />
<br /><br />

<a href="http://developer.apple.com/iphone/library/releasenotes/General/RN-iPhoneSDK-3/index.html" target="_blank" >Apple already fixed this issue with 3.1. </a> <br />

Under "Known Issues and Fixes/Core Data" <br />

"<em>The memory leak of an NSConcreteMutableData instance when processing object changes has been fixed.</em>"



]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/objective-c-cocoa-touch-iphone/nsconcretemutabledata.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="1" length="" type="" />
		</item>
		<item>
		<title>UIColor Color Codes</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/uicolor-color-codes.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/uicolor-color-codes.html#comments</comments>
		<pubDate>Sun, 18 Apr 2010 19:53:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[Objective C / Cocoa Touch [iPhone]]]></category>
		<category><![CDATA[DigitalColor Meter]]></category>
		<category><![CDATA[mac OS 10.5]]></category>
		<category><![CDATA[RGB values]]></category>
		<category><![CDATA[UIColor]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=239</guid>
		<description><![CDATA[



I Just realize how hard it was to just assign RGB Values color by code using UIColor, Well heres a little work around. Using the utilities in mac, which will you can find at Applications/Utilities folder. Open it.  


  


Make sure you selected "RGB As Percentage",  Use your mouse to move the [...]]]></description>
			<content:encoded><![CDATA[<p>
<a title="Utilities DigitalColor Icon" rel="rokzoom[digital]" href="http://malebolgia.shadowsonawall.net/images/digitalcolor/Utilities.png">
<img title="DigitalColor Meter Icon" src="http://malebolgia.shadowsonawall.net/images/digitalcolor/DigitalColorMeterIcon.png" alt="DigitalColor Meter Icon" width="133" height="110" align="right" hspace="10"   />
</a>
I Just realize how hard it was to just assign RGB Values color by code using UIColor, Well heres a little work around. Using the utilities in <strong><span style="color: #333300;">mac</span></strong>, which will you can find at <strong><span style="color: #ff0000;">Applications/Utilities</span></strong> folder. Open it.  

<br /><br /><br /><br />
<img title="DigitalColor Meter" src="http://malebolgia.shadowsonawall.net/images/digitalcolor/DigitalColorMeter.png" alt="DigitalColor Meter"  />  
<br /><br />

Make sure you selected <span style="color: #000080;"><em>"RGB As Percentage"</em></span>,  Use your mouse to move the cursor over the pixel you want to sample, and read off the values, once you got the color you want; press<span style="color: #800000;"><span style="text-decoration: underline;"> Command-Shift-H</span></span>, This will hold the color values you got for the moment. <span style="text-decoration: underline;"><span style="color: #800000;">Press F4</span></span> for Dashboard use calculator, 

<br /><br />
<img title="Dashboard Calculator" src="http://malebolgia.shadowsonawall.net/images/digitalcolor/DigitalColorMeterCalculator.png" alt="Dashboard Calculator"  />  
<br /><br />

Divide the values you got to 100, for example <span style="color: #333399;"><strong>R%: 78.8 = .788</strong></span>; Then you can finally put the RGB values on your <span style="color: #993366;"><strong>UIColor parameter</strong></span>.

<br /><br />
<img title="UIColor" src="http://malebolgia.shadowsonawall.net/images/digitalcolor/UIColor.png" alt="UIColor"  />  
<br /><br />


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#define COLOR_FOR_THIS [UIColor colorWithRed:0.788f green:0.207f blue:0.271f alpha:1.0f]</span></pre></div></div>




</p>
]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/uicolor-color-codes.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Animating View</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/make-view-move-upward-uitextfield-begin-editing.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/make-view-move-upward-uitextfield-begin-editing.html#comments</comments>
		<pubDate>Thu, 21 Jan 2010 01:55:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[Objective C / Cocoa Touch [iPhone]]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=181</guid>
		<description><![CDATA[
  Make View move upward - UITextField Begin Editing


Attached is the video - what I was trying to do, it happens that my first iPhone app has UITextField positioned where the text keypad will appear also, which will hide the current UITextField. Well I realized that I will encounter this often, so I guess [...]]]></description>
			<content:encoded><![CDATA[<p>
  <strong>Make View move upward - UITextField Begin Editing</strong>
</p>
<br />
<p>Attached is the video - what I was trying to do, it happens that my first <strong><span style="color: #808000;">iPhone</span></strong> app has <span style="color: #003300;">UITextField</span> positioned where the text keypad will appear also, which will hide the current <span style="color: #003300;">UITextField</span>. Well I realized that I will encounter this often, so I guess it's <span style="color: #333333;"><span style="text-decoration: underline;"><strong>important</strong></span></span> to have this <em><span style="color: #333333;">piece of code</span></em>.</p>
<br />
<p>in your interface builder assign the UITextField as <u>delegate</u></p>

<div id="attachment_187" class="wp-caption aligncenter" style="width: 299px"><a href="http://malebolgia.shadowsonawall.net/wp-content/uploads/2010/01/delegate.png"><img src="http://malebolgia.shadowsonawall.net/wp-content/uploads/2010/01/delegate.png" alt="UITextField as delegate" title="delegate" width="289" height="98" class="size-full wp-image-187" /></a><p class="wp-caption-text">UITextField as delegate</p></div>

<p>
on your .m file declare the static constant at the top of the code. </p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">static</span> <span style="color: #a61390;">const</span> CGFloat KEYBOARD_ANIMATION_DURATION <span style="color: #002200;">=</span> <span style="color: #2400d9;">0.3</span>;
<span style="color: #a61390;">static</span> <span style="color: #a61390;">const</span> CGFloat MINIMUM_SCROLL_FRACTION <span style="color: #002200;">=</span> <span style="color: #2400d9;">0.2</span>;
<span style="color: #a61390;">static</span> <span style="color: #a61390;">const</span> CGFloat MAXIMUM_SCROLL_FRACTION <span style="color: #002200;">=</span> <span style="color: #2400d9;">0.8</span>;
<span style="color: #a61390;">static</span> <span style="color: #a61390;">const</span> CGFloat PORTRAIT_KEYBOARD_HEIGHT <span style="color: #002200;">=</span> <span style="color: #2400d9;">216</span>;
<span style="color: #a61390;">static</span> <span style="color: #a61390;">const</span> CGFloat LANDSCAPE_KEYBOARD_HEIGHT <span style="color: #002200;">=</span> <span style="color: #2400d9;">140</span>;</pre></div></div>




<p>after at the @implementation put this global variable to be used for all events </p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"> CGFloat animatedDistance;</pre></div></div>




<p>at the textFieldDidBeginEditing event </p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>textFieldDidBeginEditing<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITextField <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>textField <span style="color: #002200;">&#123;</span>
&nbsp;
	CGRect textFieldRect <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self.view.window convertRect<span style="color: #002200;">:</span>textField.bounds fromView<span style="color: #002200;">:</span>textField<span style="color: #002200;">&#93;</span>;
    CGRect viewRect <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self.view.window convertRect<span style="color: #002200;">:</span>self.view.bounds fromView<span style="color: #002200;">:</span>self.view<span style="color: #002200;">&#93;</span>;
&nbsp;
    CGFloat midline <span style="color: #002200;">=</span> textFieldRect.origin.y <span style="color: #002200;">+</span> <span style="color: #2400d9;">0.5</span> <span style="color: #002200;">*</span> textFieldRect.size.height;
    CGFloat numerator <span style="color: #002200;">=</span>
	midline <span style="color: #002200;">-</span> viewRect.origin.y <span style="color: #002200;">-</span> MINIMUM_SCROLL_FRACTION <span style="color: #002200;">*</span> viewRect.size.height;
    CGFloat denominator <span style="color: #002200;">=</span>
	<span style="color: #002200;">&#40;</span>MAXIMUM_SCROLL_FRACTION <span style="color: #002200;">-</span> MINIMUM_SCROLL_FRACTION<span style="color: #002200;">&#41;</span> <span style="color: #002200;">*</span> viewRect.size.height;
    CGFloat heightFraction <span style="color: #002200;">=</span> numerator <span style="color: #002200;">/</span> denominator;
&nbsp;
&nbsp;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>heightFraction &lt; <span style="color: #2400d9;">0.0</span><span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
        heightFraction <span style="color: #002200;">=</span> <span style="color: #2400d9;">0.0</span>;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #a61390;">else</span> <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>heightFraction &gt; <span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
        heightFraction <span style="color: #002200;">=</span> <span style="color: #2400d9;">1.0</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
	UIInterfaceOrientation orientation <span style="color: #002200;">=</span>
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> statusBarOrientation<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>orientation <span style="color: #002200;">==</span> UIInterfaceOrientationPortrait ||
        orientation <span style="color: #002200;">==</span> UIInterfaceOrientationPortraitUpsideDown<span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
        animatedDistance <span style="color: #002200;">=</span> <span style="color: #a61390;">floor</span><span style="color: #002200;">&#40;</span>PORTRAIT_KEYBOARD_HEIGHT <span style="color: #002200;">*</span> heightFraction<span style="color: #002200;">&#41;</span>;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #a61390;">else</span>
    <span style="color: #002200;">&#123;</span>
        animatedDistance <span style="color: #002200;">=</span> <span style="color: #a61390;">floor</span><span style="color: #002200;">&#40;</span>LANDSCAPE_KEYBOARD_HEIGHT <span style="color: #002200;">*</span> heightFraction<span style="color: #002200;">&#41;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
	CGRect viewFrame <span style="color: #002200;">=</span> self.view.frame;
    viewFrame.origin.y <span style="color: #002200;">-=</span> animatedDistance;
&nbsp;
    <span style="color: #002200;">&#91;</span>UIView beginAnimations<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> context<span style="color: #002200;">:</span><span style="color: #a61390;">NULL</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>UIView setAnimationBeginsFromCurrentState<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>UIView setAnimationDuration<span style="color: #002200;">:</span>KEYBOARD_ANIMATION_DURATION<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #002200;">&#91;</span>self.view setFrame<span style="color: #002200;">:</span>viewFrame<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #002200;">&#91;</span>UIView commitAnimations<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>




<p>at textFieldDidEndEditing event </p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>textFieldDidEndEditing<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITextField <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>textField <span style="color: #002200;">&#123;</span>
    CGRect viewFrame <span style="color: #002200;">=</span> self.view.frame;
    viewFrame.origin.y <span style="color: #002200;">+=</span> animatedDistance;
&nbsp;
    <span style="color: #002200;">&#91;</span>UIView beginAnimations<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> context<span style="color: #002200;">:</span><span style="color: #a61390;">NULL</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>UIView setAnimationBeginsFromCurrentState<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>UIView setAnimationDuration<span style="color: #002200;">:</span>KEYBOARD_ANIMATION_DURATION<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #002200;">&#91;</span>self.view setFrame<span style="color: #002200;">:</span>viewFrame<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #002200;">&#91;</span>UIView commitAnimations<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>




<p>This event is textfield resign responder, once you press the return keypad it will hide the iPhone keyboard, this is important to test if the view will come back to its previous state.  </p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span>textFieldShouldReturn<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITextField <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> textField
<span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>textField resignFirstResponder<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">return</span> <span style="color: #a61390;">YES</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>




Demo.

<div id="container_UIText"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript">// <![CDATA[
var s3UIText = new SWFObject("http://malebolgia.shadowsonawall.net/flash/mediaplayer.swf","mediaplayer","388","794","8"); 
            s3UIText.addParam("allowfullscreen","true"); 		
            s3UIText.addVariable("width","388"); 		
            s3UIText.addVariable("height","794"); 		
             s3UIText.addVariable("file","http://media.shadowsonawall.net/videos/iphone_0001.flv");            
            s3UIText.addVariable("backcolor","0x000000");             
            s3UIText.addVariable("frontcolor","0xFFFFFF");             
                s3UIText.addVariable("lightcolor","0x840D16");             
                s3UIText.addVariable("screencolor","red"); 		
                s3UIText.write("container_UIText");
// ]]&gt;</script>
<br /><br />
<p> <strong><a href="http://media.shadowsonawall.net/downloads/KeyBoardTrickStudy.zip">Download the Source</a></strong> </p>]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/make-view-move-upward-uitextfield-begin-editing.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

