아이폰어플개발정보2010. 9. 11. 09:14
아이폰 os4에서 앱 종료할때 refresh하는 방법
유저가 알아서 한다. 
종료버튼 만드는건 불필요
단지 foreground로 자신의 app이 떳을때 아래함수 있용 refresh를 적절하게 하면된다.
- (void)applicationDidEnterBackground:(UIApplication *)application { } - (void)applicationWillEnterForeground:(UIApplication *)application { }
iPhone20
 
Join Date: Sep 2009
Posts: 110
 How to close an app in OS 4.0

Hello,

Wondering how to close an app in OS 4.0. 
It saves the state of an app and resumes it from where you left off. Cool feature!!
But, At some point to fetch the current data i want to completely close the application and start it over again. Any idea?

Thanks
  
 06-28-2010, 10:17 AM   #2 (permalink)
Emphasizing Fundamentals
 
 
Join Date: Jul 2009
Location: Loveland, OH
Age: 35
Posts: 2,801

No you don't. You want to use the new methods corresponding to multitasking.
__________________
My Company: BriTer Ideas LLC
My Services: Code review, consulting, development. PM for details.
My Apps: SlickShopperSports Minute (Or So)

Ways to thank me: Buy my app. Leave a PayPal donation.

Things I've Written That You Should Read:
Definitive Guide To Properties | iPhone Development Resources, Tips, and Tricks | UITableView Series(Last update: 2/24)
  
 06-28-2010, 10:37 AM   #3 (permalink)
iPhone20
 
Join Date: Sep 2009
Posts: 110

Quote:
Originally Posted by BrianSlick 
No you don't. You want to use the new methods corresponding to multitasking.
I thought there should be a way, as it would utilize resources and battery.
I think from task dock you can close the app though i never tried it on a device.
  
 06-28-2010, 11:11 AM   #4 (permalink)
Emphasizing Fundamentals
 
 
Join Date: Jul 2009
Location: Loveland, OH
Age: 35
Posts: 2,801

Starting and stopping the app should be the user's decision, not yours.

Go watch the WWDC videos related to multitasking. It is a simple matter to reload your data when the app will come to the foreground.
__________________
My Company: BriTer Ideas LLC
My Services: Code review, consulting, development. PM for details.
My Apps: SlickShopperSports Minute (Or So)

Ways to thank me: Buy my app. Leave a PayPal donation.

Things I've Written That You Should Read:
Definitive Guide To Properties | iPhone Development Resources, Tips, and Tricks | UITableView Series(Last update: 2/24)
  
 06-28-2010, 11:26 AM   #5 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 315

You can prevent your application from running the background at all by setting UIApplicationExitsOnSuspend to YES in the app's Info.plist file, but you should think very carefully before doing this. This ensures that your app is always terminated when the user closes it, but this is probably not what your users will expect or want.

A much better approach would be to rethink the way you load data in your app so that you can refresh it whenever the app resumes being active, instead of needing to completely terminate and restart it.
  
 06-28-2010, 11:48 AM   #6 (permalink)
iPhone20
 
Join Date: Sep 2009
Posts: 110

Thanks. I found that we can get the application status by using methods

Code:
- (void)applicationDidEnterBackground:(UIApplication *)application { } - (void)applicationWillEnterForeground:(UIApplication *)application { }
Now, i can easily refresh the data.

Thank you.


출처 : http://blog.naver.com/PostList.nhn?blogId=philipousys¤tPage=2
Posted by 오늘마감

댓글을 달아 주세요