は、私はここに同じ問題を抱えている
(...コメントする方法を見つけることができません)、このアプローチを試してみました。 removeAllObjectsを使用してappRecordsをクリアしましたが、2回目には記事のすべてが機能しますが、アイコンはロードされません。
- (void)applicationDidFinishLaunching:(UIApplication *)application
{// の設定をして、ウィンドウ を示しています。
あなたは、元のサンプルコードをこのように変更することで問題を再現することができ、[ウィンドウのaddSubview:[self.navigationController]表示]。 [ウィンドウmakeKeyAndVisible];
// Initialize the array of app records and pass a reference to that list to our root view controller
self.appRecords = [NSMutableArray array];
rootViewController.entries = self.appRecords;
// NSURLRequest *たURLRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:TopPaidAppsFeed]。 //self.appListFeedConnection = [[[NSURLConnection alloc] initWithRequest:urlRequestデリゲート:self] autorelease];
// Test the validity of the connection object. The most likely reason for the connection object
// to be nil is a malformed URL, which is a programmatic error easily detected during development
// If the URL is more dynamic, then you should implement a more flexible validation technique, and
// be able to both recover from errors and communicate problems to the user in an unobtrusive manner.
//
//NSAssert(self.appListFeedConnection != nil, @"Failure to create URL connection.");
// show in the status bar that network activity is starting
// [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
[self reloadData];
}
- (IBAction)リロード:(ID)、送信者{ [自己reloadData]。 }
- (ボイド)reloadData { のNSLog(@ "エントリの更新")。 [self.appRecords removeAllObjects]; // [[myTableViewController imageDownloadsInProgress] removeAllObjects];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:TopPaidAppsFeed]];
self.appListFeedConnection = [[[NSURLConnection alloc] initWithRequest:urlRequest delegate:self] autorelease];
// Test the validity of the connection object. The most likely reason for the connection object
// to be nil is a malformed URL, which is a programmatic error easily detected during development
// If the URL is more dynamic, then you should implement a more flexible validation technique, and
// be able to both recover from errors and communicate problems to the user in an unobtrusive manner.
//
NSAssert(self.appListFeedConnection != nil, @"Failure to create URL connection.");
// show in the status bar that network activity is starting
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}
こんにちはライアン、返信いただきありがとうございます。私はこれを試してみましたが、これが主なアイデアであると理解していますが、クラッシュし、handleLoadedAppsを修正してオブジェクトを消去して、RSSフィードが最初に読み込まれないようにします。それ以上のガイダンスは高く評価されます。 – Hanson
'handleLoadedApps'の' rootViewController.entries = [NSArray array]; 'を' [rootViewController.imageDownloadsInProgress removeAllObjects];に変更すると、私のために働いているようです。私の場合、 'ApplicationWillEnterForeground'に新しい' NSURLConnection'を作成します。 – MrDatabase