Re: PubSub, enclosures and "Couldn't find PSFeed of PSEntry"
Re: PubSub, enclosures and "Couldn't find PSFeed of PSEntry"
- Subject: Re: PubSub, enclosures and "Couldn't find PSFeed of PSEntry"
- From: Martin <email@hidden>
- Date: Thu, 7 Feb 2008 11:12:02 +0100
Now it's getting weird!
Let me recall the problem, the following code does *not* work:
- (void)downloadStateDidChanged:(NSNotification *)notification {
PSEnclosure *enclosure = [notification object];
PSEntry *entry = enclosure.entry;
NSLog(@"%@", entry.feed);
}
While I was looking for a workaround, I found that the following code
does work:
- (void)downloadStateDidChanged:(NSNotification *)notification {
PSEnclosure *enclosure = [notification object];
PSEntry *entry = enclosure.entry;
PSEntry *iDontUseThisVariable = [[PSClient applicationClient]
entryWithIdentifier:[entry identifier]];
NSLog(@"%@", entry.feed);
}
So calling the entryWithIdentifier method does some internal stuff so
that our entry automagically gets its feed back! To remove the
compiler warning about the unused warning, simple ignore the object
returned by the method by just calling "[[PSClient applicationClient]
entryWithIdentifier:[entry identifier]];".
I guess I should fill a bug report for this.
-Martin.
Le 6 févr. 08 à 19:09, Martin a écrit :
Hi,
My Cocoa app subscribes to several RSS feeds using the PubSub
framework. I'd like to handle the downloading of enclosures. To do
so, I observe the PSEnclosureDownloadStateDidChangeNotification:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(downloadStateDidChanged:)
name:PSEnclosureDownloadStateDidChangeNotification object:nil];
The downloadStateDidChanged will be called for any enclosure of any
entry of any feed that my application is subscribed to. So in the
implementation of downloadStateDidChanged, I'd like to know which
entry of which feed I'm dealing with. So I do something like this :
- (void)downloadStateDidChanged:(NSNotification *)notification {
PSEnclosure *enclosure = [notification object];
PSEntry *entry = enclosure.entry;
NSLog(@"%@", entry);
}
But I'm having the following error message :
[WARNING] Couldn't find PSFeed of PSEntry['My Entry Title' 1]
(FeedCore=PubSub::FeedCore[Feeds #1] 0x177950, PSClient=(null))
Am I doing something wrong?
Thanks,
-Martin.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden