开发者

Three20: Extracting NSArray from userinfo

开发者 https://www.devze.com 2023-03-03 04:25 出处:网络
I have been using Grinich\'s method of using the userinfo category for passing on objects, in which case I\'m passing an array of FeedItem class objects. However, modelItems as well as feedItems retur

I have been using Grinich's method of using the userinfo category for passing on objects, in which case I'm passing an array of FeedItem class objects. However, modelItems as well as feedItems return a null even when myPassedObject is able to print开发者_运维技巧 my items when i NSLog it.

 id myPassedObject = [query objectForKey:@"__userInfo__"];

    NSArray *modelItems = myPassedObject;

    for (FeedItem *feedItem in modelItems) {

     [feedItems addObject:feedItem];   
    }


Try casting myPassedObject to an NSArray when you assign it to modelItems. Doesn't seem to be anything else wrong.


I would print out or inspect the query dictionary to ensure that you are passing myPassedObject in correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消