Burada aynı sorunu yaşıyorum
(... Yorum yapmak bir yol bulamaz) ve bu yaklaşımı denedik. RemoveAllObjects kullanarak appRecords temizlendi, ancak ikinci kez, tüm makaleler için çalışır, ancak simgeler yüklenmez.
Orijinal numune kodu bu şekilde değiştirerek sorunu yeniden:
- (void)applicationDidFinishLaunching:(UIApplication *)application
{ // Yapılandır ve pencere göstermek [pencere addSubview: [self.navigationController görünüm]]; [window 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 ayırma] initWithRequest: urlRequest delege: 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) yeniden: (id) sevk { [kendini reloadData]; }
- (void) reloadData { NSLog (@ "girişleri güncellenmesi"); [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;
}
Merhaba Ryan, cevap için teşekkürler. Bunu denedim ve bunun ana fikir olduğunu anlıyorum ama çöker, ayrıca nesneleri temizlemek için handleLoadedApps değiştirerek RSS beslemesinin başlangıçta yüklenmesini engeller. Daha fazla rehberlik çok takdir edilecektir. – Hanson
rootViewController.entries = [NSArray dizisi]; '' '' [rootViewController.imageDownloadsInProgress removeAllObjects] 'in değiştirilmesi; 'handleLoadedApps' içinde benim için çalışıyor gibi görünüyor. Benim durumumda 'ApplicationWillEnterForeground' içinde yeni bir' NSURLConnection 'oluşturuyorum – MrDatabase