On Jun 21, 2015, at 8:44 AM, Devarshi Kulshreshtha 
<[email protected]> wrote:

> I have an array controller which stores managed objects of entity
> 'Student', I am trying to iterate over its content using below code:
> 
> for (index, element) in downloadingFilesArrayController.arrangedObjects{
> 
>           // want to do some useful things on element
> 
> }
> 
> for some reasons it is showing compilation error:
> 
> 'Type AnyObject does not conform to protocol SequenceType'
> 
> Any ideas on how can fix it?

The problem is that the arrangedObjects property of NSArrayController is typed 
as "id", not "NSArray*".  Try casting it to an array:

for (index, element) in downloadingFilesArrayController.arrangedObjects as! 
[AnyObject] {
}

Regards,
Ken


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to