I'm not sure totally why, but a Green blog asked for a link exchange with me. So for now I will post their link here. Later I will figure out how to permanently add this link to my home page.
http://blog.gogreen.vc
Sunday, October 18, 2009
Thursday, October 8, 2009
Splash Screen
Another thing that I discovered today, is that you can set a splash screen by adding an image titled "Default.png" to you project. I had added a splash screen manually before by displaying an imageView in its own View Controller and using a timer to push the table view onto the top of the stack after 3 seconds. I find the "Default.png" way to be considerably easier to implement, but it does not allow for the 3 second hang time I had previously implemented. All it does is display you image, then run the app as soon as it is loaded, which does not always allow for time to absorb what is displayed to you on the splash screen.
Thursday, September 24, 2009
Dealocated instance
My latest bump in the road occurs after having navigated through multiple images. It seems to me that this puts a strain on the memory, so the app decides to release the old NSMutableDictionaries that I have implemented for navigation. So now, after having viewed a few images, I go back into my navigation, and it crashes. I tried retaining all the NSMutableDictionaries in the .h file, at at first this seemed to help, but the problem still persists.
Edit: (10/8/09)
I finally discovered the source of all my frustration. While adding a piece of code designed to reset the "highlighted" or "selected" value on a table view back to the top entry, I had to define my own "NSIndexPath" and manually set its values. Then afterward I added a release for the variable I had just initialized, trying to be a good steward of my memory. It turns out that that release was my problem. After using "Leaks" I found out when the memory leak was happening. It had nothing to do with my dictionaries as I thought above it was due to my releasing of the NSIndexPath multiple times that caused the creation of any other tableView (ie. when I navigated back and tried a different route) to cause a crash.
And for reference the error that I received each crash was either one of these two.
"[NSIndexPath release]: message sent to deallocated instance."
"[NSIndexPath retain]: message sent to deallocated instance."
Edit: (10/8/09)
I finally discovered the source of all my frustration. While adding a piece of code designed to reset the "highlighted" or "selected" value on a table view back to the top entry, I had to define my own "NSIndexPath" and manually set its values. Then afterward I added a release for the variable I had just initialized, trying to be a good steward of my memory. It turns out that that release was my problem. After using "Leaks" I found out when the memory leak was happening. It had nothing to do with my dictionaries as I thought above it was due to my releasing of the NSIndexPath multiple times that caused the creation of any other tableView (ie. when I navigated back and tried a different route) to cause a crash.
And for reference the error that I received each crash was either one of these two.
"[NSIndexPath release]: message sent to deallocated instance."
"[NSIndexPath retain]: message sent to deallocated instance."
Sunday, August 16, 2009
UIImageView
Currently my app lets you navigate some Tableviews to get to a UIScrollview with a UIImageview in it, that is interactive. Now my problem is when I navigate back to my Tableview from my Imageview and then pull up what should be another image, and it is still the same one. One problem I have found is that the viewDidLoad method of my ImageViewController.m file is not called upon the second launch of the controller.
Edit 8/22
I finally figured it out. Instead of relying on the viewDidLoad method, which is only fired once, when the view is first called into action. I instead used the viewWillAppear method. Now at first I had a problem making this method fire. But what was needed was for it to be called in all of my viewControllers. So I added this method too all the view controllers used in my navigation, then took everything out of my viewDidLoad method and put it into the viewWillAppear method.
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
Edit 8/22
I finally figured it out. Instead of relying on the viewDidLoad method, which is only fired once, when the view is first called into action. I instead used the viewWillAppear method. Now at first I had a problem making this method fire. But what was needed was for it to be called in all of my viewControllers. So I added this method too all the view controllers used in my navigation, then took everything out of my viewDidLoad method and put it into the viewWillAppear method.
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
Hello World!
I have recently had the opportunity to start learning Iphone development and decided It would be great to post all my noob mistakes, and how I overcame them. I wish I had started this earlier because there is so much I have done wrong and so much I have learned. I just hope this recourse becomes useful to others whom are new to this exciting field.
Subscribe to:
Posts (Atom)